The Essential Guide to Unit Testing in iOS

Many developers find unit testing confusing. This is made worse by the advanced techniques you need to test classes or asynchronous code, like the one for network requests.

In reality, at the base of unit testing, there are simple fundamental concepts. Once you grasp those, unit testing suddenly becomes more approachable.

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.

A Practical SwiftUI Kickstart

SwiftUI is a revolutionary way to create user interfaces on iOS and other Apple platforms.

It introduces a new declarative syntax that allows you to build user interfaces packed with features quickly.

In this article, I will show you an overview of the SwiftUI features you will need in every iOS app you will ever build.

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.

Computed properties in Swift: A basic feature for safer and cleaner code

Computed properties are one of the basic features of the Swift language. But despite their simplicity, they are a great tool to keep your code clean and free of bugs. I rely heavily on computed properties for any code I write.

Model-View-Controller in iOS: A Blueprint for Better Apps

Since the introduction of SwiftUI, I have seen many developers write all their code inside views. Unfortunately, the simplicity of the framework seems to encourage a return of many poor practices.

But you do not build robust, maintainable apps by gluing together random pieces of code.

Sure, you can search on Google for specific tasks, copy and paste some code into your project and make it work, somehow.

That works if your app is small and simple. But as soon as you go beyond basic tutorials, you inevitably get serious problems.

That’s why the MVC and MVVM patterns exist. In this article, we will see how they apply to SwiftUI.

Protocol-Oriented Programming: The Best Tool of Expert iOS Developers

After the introduction of protocol extensions in Swift, Apple started pushing protocol-oriented programming.

Even if it was a new paradigm, it quickly got widespread adoption in Swift programming and iOS development. 

This is not a surprise. Protocol-oriented programming is a highly flexible paradigm with many benefits. One of my favorite applications is to create well-structured network requests.

Protocol-oriented programming solves many of the problems of object-oriented programming. Moreover, it works great with Swift’s value types, i.e., structures and enumerations.