Trying to understand how swift compares arrays.
var myArray1 : [String] = [\"1\",\"2\",\"3\",\"4\",\"5\"]
var myArray2 : [String] = [\"1\",\"2\",\"3\",\"4\",
Arrays conform to Equatable in Swift 4.1, negating the caveats mentioned in previous answers. This is available in Xcode 9.3.
https://swift.org/blog/conditional-conformance/
But just because they implemented
==did not meanArrayorOptionalconformed toEquatable. Since these types can store non-equatable types, we needed to be able to express that they are equatable only when storing an equatable type.This meant these
==operators had a big limitation: they couldn’t be used two levels deep.With conditional conformance, we can now fix this. It allows us to write that these types conform to
Equatable—using the already-defined==operator—if the types they are based on are equatable.