일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 스위프트
- 리펙토링
- combine
- Xcode
- uitableview
- map
- swift documentation
- Refactoring
- 클린 코드
- MVVM
- Observable
- Human interface guide
- swiftUI
- 리펙터링
- rxswift
- HIG
- ios
- collectionview
- uiscrollview
- tableView
- clean architecture
- 리팩토링
- Clean Code
- SWIFT
- ribs
- UICollectionView
- Protocol
- RxCocoa
- 애니메이션
- UITextView
- 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..