Category Archives: Uncategorized

JSON Decoding in Swift with Codable: A Practical Guide

 JSON Decoding in Swift with Codable: A Practical Guide

Encoding and decoding data is a fundamental part of iOS apps.

That is especially true for the JSON data we get from REST APIs.

In the past, decoding JSON in iOS apps required a lot of boilerplate code and sometimes fancy techniques.

But thanks to the Codable protocols introduced of Swift 4, today we have a native and idiomatic way to encode and decode data.

The Codable protocols allow for simple JSON decoding that can sometimes take only a couple of lines of code. But it also allows for more sophisticated techniques when you have special needs.

We will explore all that in this article.

Continue reading

Master Swift Generics: A practical guide to code reuse

Master Swift Generics: A practical guide to code reuse

Generics are a great feature of Swift that allow you to generalize and reuse code in ways that would not be possible otherwise.

They are also a quite advanced feature and become a roadblock for many developers. The iOS SDK uses generic extensively, something that is especially true in SwiftUI.

In this article, I will show why generics exist and how to use them in your apps.

Continue reading

Become an iOS Developer in 2020: The Ultimate Guide

More and more companies rely on mobile apps, so iOS developers are in high demand.

The talent shortage keeps driving salaries higher and higher, even for entry-level positions. So, it’s understandable that more and more people want to start a career in iOS app development.

Money is not everything, of course. Many of us do it to create something we are proud of, that makes a difference in the lives of many people.

Becoming an iOS developer takes some effort though. Whatever your motivation, here is a detailed, step-by step to become an iOS developer.

Continue reading

Weak Self in Swift Made Easy: What it is and why it’s needed

When developing iOS apps in Swift, you are bound, sooner or later, to encounter weak self references. That’s especially true in the callbacks of network requests.

At first, weak self references might seem puzzling and, sometimes, annoying. In this article, we will see why they are needed and how you can fix them in your code.

Continue reading