[Swift] Dictionary

2016. 2. 10. 15:45Computer/Apple Ecosystem Insights

Swift 에서 딕셔너리 형을 어떻게 사용하는지 보았는데

이건 완전 자바스크립트다... 우와..

편해..



// 2016. 02. 10. Ruke


// Dictionaries



var emptyDictionary = [String:String]()



var states = ["NJ":"New Jersey","NY":"New York","CA":"California","FL":"Florida","TX":"Texas"]


states.count


states["NY"] = nil


states["NY"] = "New York"


states


//states.updateValue("NYork", forKey: "NY")

states["NY"] = "NYs"


states


var products = [123:"Apples",234:"Bananas",345:"Pears",456:"Grapes"]



반응형

'Computer > Apple Ecosystem Insights' 카테고리의 다른 글

[Swift] Tuple  (0) 2016.02.10
[Swift] Set  (0) 2016.02.10
[Swift] Array  (0) 2016.02.10
[Swift] 함수  (0) 2016.02.10
[Swift] 조건문  (0) 2016.02.10