Closed Glsme closed 1 year ago
Array, Set, Dictionary 세 가지가 있다. var(변수)로 할당하면 변경이 가능하지만, let으로 할당하면 변경이 불가능하다.
Swift 의 이런 타입들은 모두
Generic Collection
모든 콜렉션 타임은 Iteratable 하다. for-in 반복문으로 순회가 가능
var intArray: [Int] = [1, 2, 3]
var threeInt = Array(repeating: 0, count: 3)
var addedArray = intArray + threeInt
Swift의 배열은
Foundation
의NSArray
클래스와 연결됨
var charSet = Set<Characters>()
var strSet: Set<String> = ["hello", "swift"]
var cats: [String: Int] = ["코숏": 3, "아메숏": 2]
순서가 없는 콜렉션
키-밸류 쌍으로 저장됨
고유한 값으로 저장됨
참고링크: https://docs.swift.org/swift-book/LanguageGuide/CollectionTypes.html
Collection Type의 종류와 특징 설명
🗓️ 마감일
2023.01.15
💁 참여자
⚠️ 마지막으로 답변 단 사람이 이슈 close 하고 리드미에 항목 업데이트 해주세요.