Learn Swift and iOS Development
Master iOS development through in-depth tutorials and comprehensive courses on Swift, SwiftUI, UIKit, Core Data, and more.
Master iOS development through in-depth tutorials and comprehensive courses on Swift, SwiftUI, UIKit, Core Data, and more.
Discover the newest tutorials on Swift and iOS development
Discover the newest tutorials on Swift and iOS development
Showing 73 to 84 of 716 posts
7:05
In the previous episode, I highlighted a few problems a typical SwiftUI application can suffer from. These problems can be resolved in several ways. In this series, we explore how the Model-View-ViewModel pattern solves these problems. The goal is to put the views of the application on a diet and decouple view logic from business logic.
11:26
In the previous episode, you learned about the benefits of Swift Concurrency and what problem it solves. Swift Concurrency solves several more problems, which we discuss later in this series. In this episode, we take a peek under the hood to understand how Swift Concurrency does its magic.
in Concurrency
4:49
With this and the next episode, I want to make sure you choose for the Model-View-ViewModel pattern for the right reasons. I want to avoid that you adopt MVVM in a project because you were told it is a sound architecture or because you think you need view models if you use SwiftUI. In this episode, I want to highlight a few problems a typical SwiftUI application can suffer from. Those problems can be resolved by the Model-View-ViewModel pattern with relative ease.
6:54
You're probably familiar with Swift's nil-coalescing operator. The nil-coalescing operator returns a fallback value if the statement on its left doesn't produce a value. I use it quite often and there is nothing inherently wrong with it. The code smell we discuss in this episode of Code Smells in Swift is the value the statement on the right of the nil-coalescing operator produces, the fallback value.
in Swift
5:59
The JSONDecoder and JSONEncoder classes make working with JSON a breeze. The true star is Codable, though. Codable, a type alias for Decodable & Encodable, is flexible and provides a lot of functionality for very little effort. From time to time, you run into a situation that makes you scratch your head. This episode covers one such situation. How do you encode null using JSONEncoder? The good news is that the solution is fairly straightforward.
11:10
Before I show you how to adopt Swift Concurrency in a project, I want to take a moment to show you why native support for concurrency was added to the language. Let's take a look at an example to better understand what problem Swift Concurrency solves.
in Concurrency
8:54
Before we take a look at Swift Concurrency, it is important that you become familiar with a few core concepts that relate to Swift Concurrency. While you may already be familiar with some of them, this episode should take away any doubt or confusion you have.
in Concurrency
5:14
Swift is a type-safe, statically typed language, which means that the compiler checks your code for type errors at compile time. Put simply, you are not able to release your application if your code contains even a single type error. That is a good thing.
in Testing
6:06
Swift is a type-safe, statically typed language, meaning that each value has a type and the compiler performs type checking at compile time. Your code won't compile if it contains type errors. The benefit is that common bugs are caught early by the compiler. Swift's type system is strict and that also has its drawbacks. It makes the language less dynamic compared to other languages you may be familiar with, such as Ruby and JavaScript.
in Patterns
3:37
If you have been reading or watching Cocoacasts for some time, then you know that the Model-View-ViewModel pattern is one of my preferred patterns for architecting applications. I have been using MVVM for several years in various projects and it continues to prove its value in every project I work on.
7:18
I love working with enums in Swift. While that may sound odd, I feel enums are undervalued and developers miss out on some of their nicer applications, especially when combined with associated values.
in Fundamentals
6:40
Types are a fundamental aspect of the Swift language. Swift's type system was pretty easy to understand in the early days. As the language matured, the type system gained in complexity to increase its flexibility. That flexibility came at a cost, though. Today's type system is pretty advanced and some aspects make your head spin.
in Fundamentals