Skip to content

Instantly share code, notes, and snippets.

@satishbabariya
satishbabariya / supercharge api calls with codable and generics.md
Created October 17, 2021 14:34
supercharge api calls with codable and generics

supercharge api calls with codable and generics

Codeables and Generics are very powerful parts of Swift. They are pretty, simple, and very powerful!

If you aren't familiar with them, I encourage you to take a look! You can find detailed information about Generics and Codable here. [Generics]https://docs.swift.org/swift-book/LanguageGuide/Generics.html and [Codable]https://developer.apple.com/documentation/swift/codable

Take this example: you have to implement an API in your app. No big deal, right? Almost anybody can do that! Let me add the pod for Alamo... no, we're not taking that route, we're going to implement everything ourselves!