Created
January 17, 2019 13:33
-
-
Save alesker/caeb58f79568fda0caf8b2a35a37e4d5 to your computer and use it in GitHub Desktop.
zopa.swift
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
typealias Zopa = (zo: Int, pa: Int) | |
func zopa(a: Int, completion: (Zopa) -> Void) { | |
let zopa = (a, a * a) | |
completion(zopa) | |
} | |
zopa(a: 9001) { _ in | |
print("dratuti") | |
} | |
zopa(a: 9001) { _, _ in | |
print("i snova dratuti") | |
} | |
zopa(a: 42) { a, _ in | |
print(a) | |
} | |
zopa(a: 42) { a, b in | |
print(a) | |
print(b) | |
} | |
zopa(a: 42) { (a, b) in | |
print(a) | |
print(b) | |
} | |
zopa(a: 42) { zopa in | |
print(zopa.zo) | |
print(zopa.pa) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment