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 | 31 |
Tags
- 애니메이션
- 리팩토링
- Refactoring
- 클린 코드
- Protocol
- Human interface guide
- Xcode
- RxCocoa
- rxswift
- map
- 리펙터링
- ribs
- uitableview
- 스위프트
- Observable
- clean architecture
- Clean Code
- MVVM
- uiscrollview
- swift documentation
- 리펙토링
- UICollectionView
- SWIFT
- tableView
- swiftUI
- collectionview
- ios
- UITextView
- combine
- HIG
Archives
- Today
- Total
목록result (1)
김종권의 iOS 앱 개발 알아가기
[iOS - swift] Result 타입 (성공, 실패)
Result 타입 성공과 실패에 대한 결과값을 반환하고 싶은 경우 사용 Result 타입은 enum이며 두 개의 제네릭한 결과를 리턴하는 것이며, Failure 제네릭은 Error를 상속받은 타입이어야 함 Success는 Value type인 (Void, String, Int)등을 사용하도 되지만 Failure는 Error를 상속받은 자료형으로 채워주어야 가능 Result 타입 사용 Success 타입 정의 (옵셔널) struct Response { let message: String = "success!" } Failure 타입 정의 (필수) enum MyErrorType: Error { case limited case abuse } Result 타입을 리턴하는 함수 정의 func requestAPI(..
iOS 기본 (swift)
2021. 2. 26. 00:00