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 |
Tags
- HIG
- 리펙토링
- map
- ribs
- uiscrollview
- rxswift
- 클린 코드
- 리펙터링
- RxCocoa
- ios
- combine
- Xcode
- swiftUI
- UICollectionView
- clean architecture
- SWIFT
- 애니메이션
- collectionview
- MVVM
- Refactoring
- tableView
- swift documentation
- UITextView
- Protocol
- Clean Code
- Observable
- 스위프트
- Human interface guide
- uitableview
- 리팩토링
Archives
- Today
- Total
목록2024/02/05 (1)
김종권의 iOS 앱 개발 알아가기
[iOS - swift] Optional Operator (옵셔널 프로퍼티 연산)
Optional Property 연산 Optional 타입인 프로퍼티가 있을때 여기에 특정 값을 더하거나, 빼거나 연산을 하고 싶은 경우 보통 아래처럼 작성 Optional binding을 시도한 후 값이 있는 경우에 10을 새로 더하는 방식 var intValue: Int? = 10 func addTen() { if let intValue { self.intValue = intValue + 10 } } 프로퍼티에 ? 를 사용하면 더욱 편리하기 표현이 가능 func addTen() { intValue? += 10 } 번외 - 조건문에서 사용 Optional타입은 enum으로 정의되어 있고 .some으로 접근하면 바로 optional binding가 가능 let optionalString = Optiona..
iOS 응용 (swift)
2024. 2. 5. 01:13