var myDict = [String:Int]()
var secondDict : Dictionary<String,Int> = [:]
딕셔너리에 초기값이 있다면
var thirdDict = ["one":1, "two":2]
반응형
'swift & iOS > swift' 카테고리의 다른 글
[swift] 딕셔너리에 for...in 으로 접근하기 (0) | 2022.02.07 |
---|---|
[swift] 딕셔너리 요소 삭제하기 (0) | 2022.02.07 |
[swift] reduce (0) | 2022.02.04 |
[swift] 배열에서 nil 이 아닌 값만 추려내기 (compactMap) (0) | 2022.02.04 |
[swift] 배열에 요소를 추가하는 append와 insert 그리고 딸기 케이크 (?) (0) | 2022.02.04 |