Skip to content

Repository files navigation

CollectionSplitting

XcodeSwiftGitHub tag (latest SemVer)GitHub

What

CollectionSplitting is a Swift Package Manager package for iOS/tvOS (10.0 and above), watchOS (4.0 and above), and macOS (10.14 and above), under Swift 5.0 and above, adding an extension to Collection in order to define a function that splits the collection into an array of sub-sequences of equal length.

publicextensionCollection{
/// Splits self into an array of sub-sequences of self, each of count `maxSize`,
/// except possibly for the last sub-sequence, which may be shorter.
///
func split(maxSize size:Int)->[SubSequence]}

Installation

CollectionSplitting is provided only as a Swift Package Manager package, because I'm moving away from CocoaPods and Carthage, and can be easily installed directly from Xcode.

License

CollectionSplitting is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages