Skip to content

Instantly share code, notes, and snippets.

@josephlord
Created February 18, 2015 00:04
Show Gist options
  • Select an option

  • Save josephlord/4522b10ec7bd087d55be to your computer and use it in GitHub Desktop.

Select an option

Save josephlord/4522b10ec7bd087d55be to your computer and use it in GitHub Desktop.
As much 1.2 only Swift as you can fit on a slide
class Swift_1_2 {
static var v = UIView()
static let d = [ "a" : 1, "b" : 3 ]
static func bar() {
let x: Set<Int>
if let a = d["a"], b = d["b"] where a < b {
x = [a, b, b-a]
} else {
x = []
}
(v as! UILabel).text = "Set: \(x)"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment