Skip to content

Instantly share code, notes, and snippets.

@raphaelmor
Created December 11, 2014 16:50
Show Gist options
  • Save raphaelmor/1fc3a519a5489332d61f to your computer and use it in GitHub Desktop.
Save raphaelmor/1fc3a519a5489332d61f to your computer and use it in GitHub Desktop.
Behold !
public init?(json: JSON) {
let optCoord = json["coordinates"]
let opt = optCoord.array?.map { jsonLineString in
jsonLineString.array?.map { jsonPosition in
jsonPosition.array?.map {
Double($0.doubleValue)
} ?? []
} ?? []
}
_lineStrings = opt ?? []
}
@raphaelmor
Copy link
Author

Does TDD say simplest code that works ? or dirtiest ? can't remember.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment