Skip to content

Instantly share code, notes, and snippets.

@up1
Last active March 15, 2016 15:38
Show Gist options
  • Select an option

  • Save up1/184c5d5240d436ccc252 to your computer and use it in GitHub Desktop.

Select an option

Save up1/184c5d5240d436ccc252 to your computer and use it in GitHub Desktop.
Swift 2.2
#if swift(>=2.2)
for counter in 0 ..< 5 {
}
#else
for var counter=0; counter < 5; counter++ {
}
#endif
#if swift(>=2.2)
print("\(#file) \(#function)")
print("\(#line) \(#column)")
#else
print("\(__FILE__) \(__FUNCTION__)")
print("\(__LINE__) \(__COLUMN__)")
#endif
var datas = Array(0...5)
datas.removeFirst()
for number in datas {
print("\(number)")
}
let data1 = ("Somkiat", "Up1")
let data2 = ("Up1", "Somkiat")
if data1 == data2 {
print("เหมือนกัน")
} else {
print("ไม่เหมือนกัน")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment