Write Shorter Conditions with the Swift Ternary Operator

The ternary operator is a conditional operator that you can use to write complex conditions using just one line of code. It is straightforward to use and powerful.

In this article, I will highlight the most common use cases of the ternary operator in Swift. I will also review the advantages and disadvantages of writing conditions using the ternary operator instead of if-else statements.

Take Decisions in Swift with If Statements and Boolean Operators

To be able to do anything interesting, a Swift program needs to take decisions based on whether some condition is true or not. This is done through conditionals.

Swift has several conditionals. The most common one is the if statement, which we will cover in this article.

Hello, World! Your First Swift Program

Learning how to program is not an easy task. But it is straightforward to get started with it by following a very simple Swift tutorial.

The very first program everyone writes is called Hello World. It teaches you the basics of creating and running a program in any language.

Powerful Advanced Swift Techniques for Complex Apps

Any iOS developer, at some point, feels the need to make the step from basic to advanced concepts.

You can get a lot of mileage from the fundamentals of Swift and iOS development.

But working on complex projects demands a new set of tools if you want your code to be reusable and remain at the same time maintainable and testable.

If you are looking to expand your Swift knowledge into more advanced topics and understand why you would need such concepts, this article is for you.

The Strategic SwiftUI Data Flow Guide (+ Infographic)

SwiftUI offers several mechanisms to pass data between views.

Such abundance can make it hard to decide which data flow mechanism fits any particular situation.

Those decisions cannot be taken in isolation. As in many other cases, we need to keep an app’s architecture in mind to make the correct choice.

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.