Skip to content

Instantly share code, notes, and snippets.

@dfyz
Created September 4, 2016 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dfyz/c57e89ee9b557eacb402c70452ac46e4 to your computer and use it in GitHub Desktop.
Save dfyz/c57e89ee9b557eacb402c70452ac46e4 to your computer and use it in GitHub Desktop.
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