[Network] 빈배열일때, 빈 String ("")으로 응답 하는 이슈
API 응답 값 중, [Item] 배열이 들어오는 곳에 값이 0개 일때, “”: String 으로 응답을 전달하여 통신오류가 발생하는 이슈모델은 [Item] 타입이므로, 타입 불일치로 네트워크 통신이 실패로 처리됨API 모델 내부에, Items가 존재하면 디코딩, 아니면 빈문자열인지 확인 후 nil로 설정 하는 이니셜라이저 구현하여 해결완료 //items가 0개 일떄 String("")으로 전달받는 것을 처리 init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) numOfRows = try container.decode(Int.self, forKey: .nu..
[iOS] Project - NuriROCK
2024. 4. 24. 23:42
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Generic
- 타입불일치
- 라우터패턴
- 한국관광공사
- tabman
- ios
- API
- layout
- custommodifier
- optimisticui
- routerpattern
- Swift
- SwiftUI
- UserDefaults
- Xcode
- collectionView
- remakeconstraints
- DiffableDataSource
- Alamofire
- accessibilityidentifier
- makeconstraints
- Concurrency
- SnapKit
- 빈배열
- Router
- PropertyWrapper
- TableView
- network
- urlsession
- RxSwift
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함