//: Playground - noun: a place where people can play
import UIKit
Int32.max
Int64.max
Int32.min
INT64_MAX
true
false
true == 1
true == 0
true == "a"
true == ""
false == "a"
false == 0
var a1 : Character = "f"
var a2 : Character = ":"
var a3 : Character = "x"
var user = "john"
var indexCount = 24
let maxCount = 100
var message = "\(user) has \(indexCount) message. Capa remaining is \(maxCount - indexCount)"
println(message)
var newLine = "\n"
var aaa = "\\ "
println(maxCount)
indexCount = 1
var userCnt : Int = 10
// 튜플
let myTuple = (10 , 42.1 , "this")
myTuple.0
myTuple.2
myTuple.1
println(myTuple)
let (mInt , _ , mString) = myTuple
println(mInt )
println(mString)
// optional
var index : Int?
if index != nil {
println("nil")
}else{
println("not nil")
}
index=3
var treeArray = ["pak","pine","yew","brich" ]
if index != nil {
println(treeArray[index!])
}
else{
println("index does not value" )
}
if let myValue = index {
println(treeArray[myValue])
}
var result: Bool?
var x1 = 10
var y1 = 20
result = x1 < y1
x1..<y1
for var i = 0 ; i < 10 ; i++ {
println(" >> \(i)")
}
for index in 1...5 {
println(" >> \(index)")
}
[IOS/Swift] 연습 기록 (0) | 2015.06.03 |
---|---|
맥 OS 환경변수 설정 (0) | 2015.05.23 |
[JAVA 잡지식] Switch 는 int 형만 사용가능한가? (0) | 2015.05.17 |