home.social

#codable — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #codable, aggregated by home.social.

  1. Все не так с Codable

    Привет, Хабр! На связи Кристиан Бенуа, iOS-разработчиĸ в Т-Банĸе. Быстродействие мобильных приложений — один из критериев, влияющих на успех не только приложения, но и всего бизнеса. Особое внимание должно уделяться производительности кода в стандартной библиотеке языка, так как этот код используется почти во всех приложениях, которые написаны на этом языке. Расскажу, как мы сделали pull request в swift-foundation и внесли несколько оптимизаций в JSONDecoder / JSONEncoder , ускорив сериализацию и десериализацию в два раза. В конце обсудим, как получить эту оптимизацию без ограничений по версии iOS и насколько можно ускорить работу с JSON в приложении.

    habr.com/ru/companies/tbank/ar

    #ios #swift #codable #json

  2. My CodableWrappers library was featured on this month’s Swift.org community showcase! swift.org/packages/showcase.ht check it out here if you’re looking to improve Codable ergonomics 🤓: swiftpackageindex.com/GottaGet #swiftlang #swift #codablewrappers #oss #github #iosdeveloper #codable

  3. Groc 3 xAI в разработке iOS приложения «Страны Мира» (отображение границ)

    В предыдущей статье я писала о создании довольно простого тестовое iOS приложение Countries, которое показывает все страны Мира по регионам (Европа, Азия, Латинская Америка и т.д.) и для каждой страны её название и флаг. Если вы выбираете какую-то страну, то о ней сообщается дополнительная информация о численности населения population и размере ВВП (валового внутреннего продукта) gdp. Я хочу добавить на карту границы страны. На данный момент я ничего не знаю о том, где взять информацию о границах стран, но это должен быть либо JSON файл, либо JSON информация из интернета, которую можно считать с помощью async / await и декодировать в Swift. Я хочу обратиться к Groc 3 xAI и попросить его написать для меня Swift код, который бы добавил границы выбранной страны на карту. Забегая вперед, скажу, что Groc 3 xAI практически полностью справился со всеми моими запросами, предложив совершенно неожиданное для меня решение со встроенным в MapKit декодером MKGeoJSONDecoder. Тем не менее я попросила Groc 3 создать Codable Модель в Swift для декодирования GeoJSON данных, и он с ней превосходно справился. По ходу дела Groc 3 вообще выдал целый "Комплексный обзор о получении GeoJSON данных стран" и предоставил очень четкие "рассуждения", которые вполне можно использовать как отличный обучающий материал.

    habr.com/ru/articles/887094/

    #Groc_3 #ии #ios_разработка_swift #Groc #ai #map #codable #JSONDEcoder

  4. #Swift #Codable

    I confess

    I have gotten by in my Swift career with having written very few custom Codables

    I was writing one today and it mostly went OK

    But there is a language/API wart when iterating over children of an unkeyed container

    I got to this part of the API and I went “WTF, who does it like that”

    Shouldn’t it be like a Sequence or something, so I could do “for nestedContainer in container” or something like that

  5. Parsing JSON Data is a fundamental in modern SwiftUI apps. This comprehensive guide covers all the aspects of the Codable protocols in Swift.

    #JSON #Programming #Swift #SwiftUI #macOS #iOS #visionOS #Codable
    matteomanferdini.com/swift-par

  6. And now a simple but pretty thorough implementation of an Encoder with tests. (Although still more of a toy / somewhere to start than something anyone should use.)

    - whynotestflight.com/excuses/an

    - github.com/carlynorama/CoderEx

    It goes on forever. As I say in the summary 1578 lines down: "Encoders. Not so fiddly if one can be ruthless in vetting the input. Interminable to write if trying to be general purpose. "

    And this one isn't even configurable!

    #Codable, #Encoder, #SwiftLang

  7. Continuing on with that WebExtension, but with a detour in custom Encoders

    whynotestflight.com/excuses/ho

    Found the best thing for it was copying and making crazy graphs of some existing encoders in the Apple/GitHub repos. Here's 4

    I found the comparison between the two different JSONEncoder implementations particularly interesting.

    #Codable, #Encoder, #SwiftLang, #JSON, #JSONEncoder, #URIEncoder

  8. Wusstest du, dass die richtige Verwendung des Codable-Protokolls dir helfen kann, effizient mit JSON-APIs zu arbeiten? Sei dabei, wenn @5sw in seinem Vortrag wertvolle Tipps und Tricks teilt!

    Hol Dir jetzt Dein Ticket: macoun.de/anmelden

    #Codable #AppEntwicklung #JSONAPIs #Effizienz #macounFFM

  9. You know how conforming to Codable makes it so any UIView subclass has to implement codable (even if it just is to fatalError() because you only ever plan to create the view in code).

    Is there a good #Swift design pattern for creating class hierarchies like that? Where the base class supports and implements a feature, but you don't want subclasses to be forced to provide it?

    #swiftLang #codable #designPatterns #programming

  10. #Swift #Codable

    Is this weird? Or normal?

    I needed a type which is codable so I can archive/transmit it in various ways, which boxes a result with noncodable types.

  11. More work on my app.

    Been trying to set it up so #CoreData objects can be created and updated from the objects sent from the API using the #Codable protocol.

    It has had its headaches but I got it mostly set up, even to the point of updating existing objects in the data store.

    My issue comes when I hit a collection of objects. I’m not sure how to handle inside of the init(from: Decoder) when some or all of those objects are already in my store

    #Swift

  12. Continuing on with that WebExtension, but with a detour in custom Encoders

    whynotestflight.com/excuses/ho

    Found the best thing for it was copying and making crazy graphs of some existing encoders in the Apple/GitHub repos. Here's 4

    I found the comparison between the two different JSONEncoder implementations particularly interesting.

    #Codable, #Encoder, #SwiftLang, #JSON, #JSONEncoder, #URIEncoder

  13. Continuing on with that WebExtension, but with a detour in custom Encoders

    whynotestflight.com/excuses/ho

    Found the best thing for it was copying and making crazy graphs of some existing encoders in the Apple/GitHub repos. Here's 4

    I found the comparison between the two different JSONEncoder implementations particularly interesting.

    #Codable, #Encoder, #SwiftLang, #JSON, #JSONEncoder, #URIEncoder

  14. Continuing on with that WebExtension, but with a detour in custom Encoders

    whynotestflight.com/excuses/ho

    Found the best thing for it was copying and making crazy graphs of some existing encoders in the Apple/GitHub repos. Here's 4

    I found the comparison between the two different JSONEncoder implementations particularly interesting.

    #Codable, #Encoder, #SwiftLang, #JSON, #JSONEncoder, #URIEncoder

  15. Continuing on with that WebExtension, but with a detour in custom Encoders

    whynotestflight.com/excuses/ho

    Found the best thing for it was copying and making crazy graphs of some existing encoders in the Apple/GitHub repos. Here's 4

    I found the comparison between the two different JSONEncoder implementations particularly interesting.

    #Codable, #Encoder, #SwiftLang, #JSON, #JSONEncoder, #URIEncoder

  16. Wusstest du, dass die richtige Verwendung des Codable-Protokolls dir helfen kann, effizient mit JSON-APIs zu arbeiten? Sei dabei, wenn @5sw in seinem Vortrag wertvolle Tipps und Tricks teilt!

    Hol Dir jetzt Dein Ticket: macoun.de/anmelden

    #Codable #AppEntwicklung #JSONAPIs #Effizienz #macounFFM

  17. Wusstest du, dass die richtige Verwendung des Codable-Protokolls dir helfen kann, effizient mit JSON-APIs zu arbeiten? Sei dabei, wenn @5sw in seinem Vortrag wertvolle Tipps und Tricks teilt!

    Hol Dir jetzt Dein Ticket: macoun.de/anmelden

    #Codable #AppEntwicklung #JSONAPIs #Effizienz #macounFFM

  18. Wusstest du, dass die richtige Verwendung des Codable-Protokolls dir helfen kann, effizient mit JSON-APIs zu arbeiten? Sei dabei, wenn @5sw in seinem Vortrag wertvolle Tipps und Tricks teilt!

    Hol Dir jetzt Dein Ticket: macoun.de/anmelden

    #Codable #AppEntwicklung #JSONAPIs #Effizienz #macounFFM

  19. Wusstest du, dass die richtige Verwendung des Codable-Protokolls dir helfen kann, effizient mit JSON-APIs zu arbeiten? Sei dabei, wenn @5sw in seinem Vortrag wertvolle Tipps und Tricks teilt!

    Hol Dir jetzt Dein Ticket: macoun.de/anmelden

    #Codable #AppEntwicklung #JSONAPIs #Effizienz #macounFFM