Skip to content

Repository files navigation

EquatableArray

CI StatusVersionLicensePlatform

As of this writing (Swift 2.1) ordinary arrays can't be Equatable. I wanted do do something likes this:

extensionArray:Equatablewhere Element:Equatable{
// Aaaww...no go, me so sad :'(
}

So I wrapped an array in EquatableArray instead, you can use it like this:

letstuff:EquatableArray=["Hello","No"]

And now I can pass it along to functions expecting an Equatable If you make it a var you can append/remove just as you would with an array:

varstuff:EquatableArray=["Hello","No"]
stuff.append("Yo!")
stuff.removeLast()

I'm sure Apple will fix this in a future version of Swift, but until then...

Requirements

Installation

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

pod"EquatableArray"

Author

Joakim Gyllström, joakim@backslashed.se

License

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

About

An equatable array in Swift

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages