Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Human interface guide
- rxswift
- RxCocoa
- ios
- uitableview
- 스위프트
- SWIFT
- swiftUI
- UICollectionView
- 리펙터링
- Protocol
- UITextView
- 리팩토링
- Xcode
- Observable
- ribs
- 클린 코드
- tableView
- Refactoring
- 리펙토링
- clean architecture
- HIG
- 애니메이션
- swift documentation
- MVVM
- combine
- uiscrollview
- collectionview
- Clean Code
- map
Archives
- Today
- Total
목록Subscript (1)
김종권의 iOS 앱 개발 알아가기
[iOS - swift 공식 문서] 12. Subscripts
Subscripts 배열에서의 Random Access하기 위해 index값을 사용하는데, 이때 인덱스 값이 'Subscripts' ex) arr[3] = 1 swift에서는 class, struct, enum의 []연산자를 subscript 키워드를 통해 정의 가능 swift의 subscript 키워드 swift는 subscript를 정의하여 sequence가 아니더라도 특정 연산이 되게끔 가능 struct TimeTable { let multiplier: Int subscript(index: Int) -> Int { return multiplier * index } } let threeTimeTable = TimeTable(multiplier: 3) print(threeTimeTable[5]) // ..
swift 공식 문서
2021. 7. 3. 22:39