Skip to content

Instantly share code, notes, and snippets.

@dfyz dfyz/wut.swift
Created Sep 4, 2016

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
You can’t perform that action at this time.