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
- 클린 코드
- Clean Code
- 리펙터링
- ribs
- Observable
- UITextView
- uiscrollview
- Human interface guide
- tableView
- ios
- 스위프트
- swiftUI
- SWIFT
- clean architecture
- combine
- 리펙토링
- uitableview
- swift documentation
- UICollectionView
- MVVM
- HIG
- map
- collectionview
- Xcode
- Protocol
- RxCocoa
- rxswift
- 애니메이션
- 리팩토링
- Refactoring
Archives
- Today
- Total
목록private(set) (1)
김종권의 iOS 앱 개발 알아가기
[iOS - swift] private(set) 외부에서 읽기만 가능하고, 내부에서는 쓰기가 가능하도록 하는 간결한 코드 (getter, setter)
스위프트의 private(set) 키워드 private(set)을 쓰지 않고 외부에서 읽기만 가능하고 내부에서만 수정이 가능하도록 하는 코드 public class Data { private var _id: String public var id: String { get { return _id } set { return _id = id } } } private(set) 사용 public class Person { internal private(set) var id: String } internal은 생략해도 무방 읽기는 internal, 쓰기는 private으로 접근 제한이 정의된 프로퍼티 id public class Person { private(set) var id: String }
iOS 기본 (swift)
2021. 9. 6. 22:48