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
- swift documentation
- SWIFT
- 리펙토링
- swiftUI
- Refactoring
- Human interface guide
- scrollview
- HIG
- tableView
- 리팩토링
- UITextView
- UICollectionView
- 스위프트
- RxCocoa
- ios
- Xcode
- ribs
- uiscrollview
- clean architecture
- 애니메이션
- Protocol
- Observable
- uitableview
- rxswift
- collectionview
- MVVM
- map
- Clean Code
- 클린 코드
- combine
Archives
- Today
- Total
목록rethrows (1)
김종권의 iOS 앱 개발 알아가기
throws 함수 내부에서 오류를 밖으로 던지고, 사용하는 쪽에서 그 오류를 처리할 때 사용하는 키워드 throws키워드는 함수 시그니처의 반환 전 화살표 좌측에 사용 enum MyError: Error { case negativeValue } func plus(one: Int, two: Int) throws -> Int { guard one < 0 && two < 0 else { throw MyError.negativeValue } return one + two } throws 처리 do { let value = try plus(one: -1, two: 2) print(value) } catch { print(error) } rethrows 파라미터로 전달받은 함수가 에러를 던질 때 사용 이름이 ret..
iOS 기본 (swift)
2022. 4. 15. 22:37