Skip to content

A pure Swift collection implementation of uniquely ordered objects

License

Notifications You must be signed in to change notification settings

leodabus/OrderedSetAlgebra

Repository files navigation

OrderedSetAlgebra

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

OrderedSetAlgebra is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'OrderedSetAlgebra'

Usage

var ordereSet1: OrderedSet = [1,2,3,4,5,6,1,2,3]  // [1, 2, 3, 4, 5, 6]
var ordereSet2: OrderedSet = [4,5,6,7,8,9,7,8,9]  // [4, 5, 6, 7, 8, 9]

ordereSet1 == ordereSet2                     // false
ordereSet1.union(ordereSet2)                 // [1, 2, 3, 4, 5, 6, 7, 8, 9]

ordereSet1.intersection(ordereSet2)          // [4, 5, 6]
ordereSet1.symmetricDifference(ordereSet2)   // [1, 2, 3, 7, 8, 9]

ordereSet1.subtract(ordereSet2)              // [1, 2, 3]
ordereSet2.popLast()                         // 9

Author

Leonardo Dabus, leodabus@gmail.com

License

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

About

A pure Swift collection implementation of uniquely ordered objects

Resources

License

Stars

Watchers

Forks

Packages

No packages published