Skip to content

Instantly share code, notes, and snippets.

@dfyz
Created September 4, 2016 21:51
Embed
What would you like to do?
class Point {
let x = 0
}
func printPoints(points: [Point?]) {
for maybePoint in points {
if let point = maybePoint {
print(point.x)
}
}
}
// вариант A
let points = [Point()]
printPoints(points)
// вариант Б
printPoints([Point()])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment