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 |
Tags
- swift documentation
- 리팩토링
- 애니메이션
- 클린 코드
- swiftUI
- ribs
- rxswift
- ios
- 리펙터링
- combine
- MVVM
- uitableview
- Clean Code
- uiscrollview
- map
- RxCocoa
- 스위프트
- SWIFT
- Protocol
- Refactoring
- HIG
- UICollectionView
- tableView
- Xcode
- Human interface guide
- collectionview
- clean architecture
- Observable
- UITextView
- 리펙토링
Archives
- Today
- Total
목록Enum with raw type cannot have cases with arguments (1)
김종권의 iOS 앱 개발 알아가기
[iOS - swift] enum의 RawPresentable과 associated type 개념 (Enum with raw type cannot have cases with arguments)
enum의 RawRresentable 개념 enum에서 각 case들은 rawValue(원시값)을 가질 수 있음 enum이 Rawpresentable을 따르게 되면 아래처럼 rawValue로도 초기화할 수 있고 rawValue 프로퍼티로 값을 가져올수도 있음 즉 RawPresentable은 case문에 관해 값을 초기화하고 해당 값을 또 리턴할 있는 것 public protocol RawRepresentable { associatedtype RawValue init?(rawValue: Self.RawValue) var rawValue: Self.RawValue { get } } 암묵적인 RawPresentable enum을 만들 때 옆에 Int와 같은 타입을 따르게 되면 암묵적으로 RawValue가 In..
iOS 응용 (swift)
2023. 5. 2. 01:19