subtle & plausible

고정 헤더 영역

글 제목

메뉴 레이어

subtle & plausible

메뉴 리스트

    • 분류 전체보기 (118)
      • TIL (89)
        • #100DaysOfSwiftUI (44)
        • 리액트 네이티브 (6)
        • 실용주의 단위 테스트 (9)
        • App Architecture (5)
        • Combine (4)
        • Metal (2)
        • RxSwift (8)
        • Swift Codable (7)
        • TDD iOS (4)
      • 실험실 (3)
      • 책 (15)
      • 오프 (5)
      • 기타 (6)

    검색 레이어

    subtle & plausible

    검색 영역

    컨텐츠 검색

    TIL/Swift Codable

    • Guide To Swift Codable. Chapter 7: Implementing a MessagePack Encoder

      2018.08.09 by box-jeon

    • Guide To Swift Codable. Chapter 6: Building a Baggage Scanning App with Core Data

      2018.08.03 by box-jeon

    • Guide To Swift Codable. Chapter 5: Building an In-Flight Service App with User Defaults

      2018.05.16 by box-jeon

    • Guide To Swift Codable. Chapter 4: Building a Music Store App with iTunes Search API

      2018.05.11 by box-jeon

    • Guide to Swift Codable. Chapter 3: Taking the Controls

      2018.04.30 by box-jeon

    • Guide to Swift Codable. Chapter 2: Holding Patterns

      2018.04.22 by box-jeon

    • Guide to Swift Codable. Chapter1: First Flight

      2018.04.21 by box-jeon

    Guide To Swift Codable. Chapter 7: Implementing a MessagePack Encoder

    The problem of data serialization and interchange is much larger than requesting JSON over HTTP. Foundation framework이 제공하고 있는 Encoder와 Decoder는 JSON과 PropertyList 뿐입니다. 보통은 JSONEncoder/JSONDecoder로 충분하겠지만, 그 외의 방식을 사용하게 될 때 우리는 Encoder를 어떻게 작성하면 되는지 설명합니다. 따라서 작성해보고 있었는데 KeyedEncodingContainerProtocol의 superEncoder()와 superEncoder(forKey:)가 무슨 기능인지, 어떻게 구현해야할지 모르겠어서 막혔습니다. Decoder는 숙제라며 소개하고 있지..

    TIL/Swift Codable 2018. 8. 9. 04:09

    Guide To Swift Codable. Chapter 6: Building a Baggage Scanning App with Core Data

    Core Data의 'one of the greatest pain points'로 'awkward fetch-or-insert-and-update dance'를 들고 있는데, iOS9과 macOS El Capitan부터 unique constraints를 사용할 수 있게 됨으로써 NSManagedObjectContext를 저장만 하면 자동으로 처리해준다고 합니다. (브런치도 awkward dancing 중인데, 이제 그만 쉬게 해줘야...) NSManagedObjectContext의 mergePolicy를 NSMergeByPropertyObjectTrumpMergePolicy로 설정하면 된다고 하네요. Trump의 뜻을 찾아봐도 왜 trump가 들어가는지 이해가 안가서 문서를 확인해봤습니다. NSMerg..

    TIL/Swift Codable 2018. 8. 3. 17:16

    Guide To Swift Codable. Chapter 5: Building an In-Flight Service App with User Defaults

    챕터 제목에 User Defaults가 나오지만 메인은 Property List를 encode/decode 하는 방법입니다. Property List (.plist)Apple ecosystem에서 사용되는 XML 포맷의 파일입니다. 지원하는 데이터 타입은 다음과 같습니다. JSON과 달리 integer와 floating-point를 구분해서 제공하고 date와 data를 지원하기 때문에, PropertyListDecoder는 decodingStrategy 같은 것이 필요치 않습니다.array: dictionary: (with )string: integer: floating-point: binary data: date: boolean: or PropertyListDecoder승무원이 기내에서 사용할 주문내..

    TIL/Swift Codable 2018. 5. 16. 08:11

    Guide To Swift Codable. Chapter 4: Building a Music Store App with iTunes Search API

    iTunes Search APIDocument: https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/API: https://itunes.apple.com/search?term=jack+johnson&limit=1 문서도 잘 되어 있고 맞춰서 struct를 작성하는 것이 어렵지 않습니다. Value가 특정한 값으로 한정되어 있는 경우, Decodable을 conform하는 enum을 생성하면 됩니다. AFNetworking과 Alamofire 덕분에 저는 지금까지 remote api request를 직접 구현해본 적이 없을 정도인데, 정작 (AFNetworking과 Alamofire를 직접..

    TIL/Swift Codable 2018. 5. 11. 23:46

    Guide to Swift Codable. Chapter 3: Taking the Controls

    역시 고수들은 언제나 길을 찾아내는군요. 절 좌절시켰던 몇몇 상황들을 멋지게 풀어내고 있습니다. 정 안되면 그냥 JSONSerialization을 쓰라며 겸손한 마무리까지... - Decoding Unknown Keys Key가 런타임에 결정되는 경우, enum을 사용할 수가 없습니다. CodingKey를 conform하는 struct를 정의한 후, 객체를 생성해서 decode key로 넘기는 방법을 사용합니다. - Decoding Indeterminate Types type key를 가지며, type에 따라 다른 구조를 갖는 경우입니다. type에 맞춰 enum을 정의한 후, associated value에 각각의 객체를 담아서 처리합니다. - Decoding Arbitrary Types metadat..

    TIL/Swift Codable 2018. 4. 30. 22:11

    Guide to Swift Codable. Chapter 2: Holding Patterns

    Decodable을 conform할 때 맞닥드릴 수 있는 몇 가지 케이스들을 다루고 있습니다. - Nested Object - Enumeration - Key/Property Name Mismatches - Date - Null Value enum CodingKeys를 정의만 해도 알아서 사용하는 걸 보면 일종의 예약어처럼 동작하는 것으로 보입니다. 서둘러 3장으로 가야겠네요.

    TIL/Swift Codable 2018. 4. 22. 10:44

    Guide to Swift Codable. Chapter1: First Flight

    https://gumroad.com/l/codable(티스토리에 오픈그래프를 넣으려면 어떻게 해야 하는가...) Mattt Thompson(https://mat.tt)이 Flight School이라는 새로운 프로젝트를 시작하는 모양입니다. 그의 명성도 명성이지만 Codable이라니... 줄 서 있는 책들이 많지만 유혹을 떨칠 수가 없었습니다. 작년에 Codable이 처음 소개 되었을 때 일에 바로 적용해보았지만, 몇 가지 케이스들이 해소가 안되고(못하고) 레퍼런스가 부족해서, 후일을 기약하며 롤백한 적이 있습니다. 현재 Object Mapper(https://github.com/Hearst-DD/ObjectMapper)를 사용 중이고 대체로 만족하고 있지만, encoding과 decoding을 분리해서 ..

    TIL/Swift Codable 2018. 4. 21. 14:01

    추가 정보

    인기글

    최신글

    페이징

    이전
    1
    다음
    깃헙 브런치 링크드인
    subtle & plausible
    페이스북 트위터 인스타그램 유투브 메일

    티스토리툴바