Created
May 19, 2020 19:12
-
-
Save bestiosdeveloper/a858845b93bdcbca230069c9eafe46ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let locations = [(latitude: 63.3454, longitude: 12.4543), (latitude: 54.5434, longitude: 23.6434), (latitude: 63.2443, longitude: 23.7545)] | |
let origin = (latitude: 0.00, longitude: 0.00) | |
// error: Argument type '(latitude: Double, longitude: Double)' does not conform to expected type 'Equatable' | |
if locations.contains(origin) { | |
// do some serious calculations here | |
} | |
// error: Referencing instance method 'sorted()' on 'Sequence' requires that '(latitude: Double, longitude: Double)' conform to 'Comparable' | |
let sortedLocations = locations.sorted() | |
// error: Type '(latitude: Double, longitude: Double)' does not conform to protocol 'Hashable | |
let uniqueLocations = Set(locations) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment