일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- swiftUI
- ios
- uitableview
- UICollectionView
- 리펙터링
- tableView
- clean architecture
- map
- ribs
- SWIFT
- Xcode
- Observable
- 리펙토링
- Clean Code
- Human interface guide
- 클린 코드
- UITextView
- Protocol
- rxswift
- HIG
- RxCocoa
- 리팩토링
- 애니메이션
- uiscrollview
- swift documentation
- MVVM
- 스위프트
- Refactoring
- collectionview
- combine
- Today
- Total
목록CodingKeys (2)
김종권의 iOS 앱 개발 알아가기
* 기본적인 Codable, Decode, Encode 개념은 이곳 참고 * 관련 포스팅 글 json, codable, nestedContainer(keyedBy:forKey:), Decoding 중첩 모델 처리 방법 (디코딩) json, codable, nestedContainer(keyedBy:forKey:), Encoding 중첩 모델 처리 방법 (인코딩) json, codable, nestedContainer(keyedBy:forKey:), KeyedCodable로 중첩 모델 처리 방법 중첩 모델을 flatten 모델로 정의 방법 { "user_id": "jake", "blog_info": { "name": { "first": "iOS 앱 개발 알아가기", "second": "SwiftUI 앱 개..
codable을 사용하여 json데이터를 가져오는 것 json자료형을 직접 파싱해서 사용하는 것은 코드상의 복잡함이 따름 -> 미리 struct형을 정해놓고 거기에 매핑되게끔하는 방법 case #1. 일반적인 사용방법 // json데이터 형태를 미리 정의 struct DataForm: Codable { var key_name1: String? var key_name2: String? } // json데이터 let sample = """ { "key_name1": "value1", "key_name2": "value2" } """.data(using: .utf8)! // 결과 let result = try! JSONDecoder().decode(DataForm.self, from: sample) print..