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
- swift documentation
- ribs
- clean architecture
- UICollectionView
- uitableview
- tableView
- Refactoring
- Clean Code
- SWIFT
- ios
- 애니메이션
- MVVM
- combine
- map
- 리펙토링
- 리펙터링
- 리팩토링
- 클린 코드
- UITextView
- Observable
- RxCocoa
- uiscrollview
- rxswift
- Protocol
- Xcode
- collectionview
- swiftUI
- HIG
- 스위프트
Archives
- Today
- Total
목록down casting (1)
김종권의 iOS 앱 개발 알아가기
[iOS - swift] 타입 캐스팅 (업 캐스팅 vs 다운 캐스팅)
업 캐스팅 객체를 상위 클래스(super class)로 변경 하위 클래스(sub class)는 항상 상위 클래스의 부분집합 이므로 언제나 성공: as로 접근 let myScrollView = CustomScrollView() myScrollView as UIView 다운 캐스팅 객체를 하위 클래스로 변경 실패할 수 있으므로 optional 형태: as!, as? 로 접근 let myScrollView = CustomScrollView() myScrollView as? CustomScrollView() check(scrollView: myScrollView) func check(scrollView: UIScrollView) { print(scrollView as? CustomScrollView) // 다운..
iOS 기본 (swift)
2021. 4. 8. 22:56