일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- struct
- IOS
- Git
- url
- Foundation
- 코딩테스트
- initializer
- Terminal
- UIKit
- instance
- String
- delegate
- tuist
- optional
- initalizer
- Swift
- 디자인패턴
- interpace
- Unicode
- 스위프트
- 이니셜라이저
- Xcode
- Protocol
- enum
- init
- property
- Class
- Method
- extension
- type
Archives
- Today
- Total
목록2021/08/05 (1)
아리의 iOS 탐구생활
[Swift] Dictionary
✔️ 특징 키와 값이 쌍으로 이루어진 자료형 [key : value] 순서가 없는 컬렉션이다. > key나 value를 원하는 규칙으로 정렬하면서 순회. value는 중복 가능, key는 중복 불가 ✔️ 기본적인 초기화 let dic: [String : Double] = [:] let dic2 = [String : Double]() let dic3 = [1 : "100만원", 2 : "50만원" , 3 : "10만원"] // 타입유추 ✔️ uniqueKeysWithValues 배열에 value를 임의로 추가하여 새 Dictionary로 초기화. Array > [key, value] let arr = ["own", "two", "three", "four"] let dic = Dictionary(unique..
Swift/자료구조
2021. 8. 5. 15:33