Swift Tutorials

Want to learn Swift, the powerful programming language for iOS and macOS? Check out these tutorials, and improve your Swift skills starting right now!


  • Object-Oriented Programming (OOP) in Swift

    Object-Oriented Programming (OOP) in Swift
    August 4 2020 in App Development Object-Oriented Programming (OOP) helps you structure your Swift code. This article introduces classes, objects, properties, functions, and inheritance, and how to use them in Swift. Let's get started!

  • Functions in Swift Explained

    Functions in Swift Explained
    August 4 2020 in App Development In Swift you use functions to perform specific tasks in your code. It's that simple! In this article you'll learn how to define and call functions, how to use function parameters, and how to return a value from the function.

  • Variables and Constants in Swift Explained

    Variables and Constants in Swift Explained
    August 4 2020 in App Development You use variables and constants in Swift to store information. In this tutorial you'll learn how to declare and initialize variables, how to use them, and how type inference works. Let's get started!

  • Type Casting in Swift Explained

    Type Casting in Swift Explained
    August 3 2020 in App Development You use type casting in Swift to treat an instance of one class as another, in the same class hierarchy. In this article you'll learn how to use type casting in Swift. We'll take a look at upcasting, downcasting, checking types, and their syntax.

  • Promises in Swift

    Promises in Swift
    July 29 2020 in App Development Promises in Swift simplify your asynchronous code. Instead of "callback hell" you create a concise chain of async functions and keep your code clean. Let's find out how!

  • How To Find Strings with Regular Expressions in Swift

    How To Find Strings with Regular Expressions in Swift
    July 26 2020 in App Development How do you find strings with regular expressions in Swift? In this tutorial, we'll code a function from scratch that extracts hashtags from a string. Happy coding!

  • Dependency Injection in Swift

    Dependency Injection in Swift
    July 18 2020 in App Development Dependency Injection sounds scary... but it's actually pretty simple. On top of that, understanding dependency injection will greatly improve your code quality and productivity as a Swift developer!

  • Working with UserDefaults in Swift

    Working with UserDefaults in Swift
    July 15 2020 in App Development UserDefaults are useful for storing small pieces of data in your app. You use it to save your app user's settings, set some "flags", or simply use it as a tiny data store. You learn how to use UserDefaults in this article.

  • FlatMap and CompactMap Explained in Swift

    FlatMap and CompactMap Explained in Swift
    July 12 2020 in App Development Swift has a bunch of functions that are useful for transforming collections and sequences. In this tutorial, we'll discuss map(_:), flatMap(_:) and compactMap(_:).

  • Map, Reduce and Filter in Swift

    Map, Reduce and Filter in Swift
    July 9 2020 in App Development In Swift you use map(), reduce() and filter() to transform collections, like arrays, without using a for-loop. They're quite powerful, but also challenging. Let's dive in!

  • For Loops in Swift (How To)

    For Loops in Swift (How To)
    July 7 2020 in App Development Let's get loopy! Loops are used in Swift to repeat code or to iterate over collections. This article shows you how to use for-in, while and repeat-while loops, as well as looping over ranges and collections. (That's a lot of loops...)

  • Sets in Swift Explained

    Sets in Swift Explained
    July 5 2020 in App Development Sets in Swift are powerful. They're similar to arrays and dictionaries, but also very different... The "Set" collection type is an interesting aspect of Swift programming. Let's find out how you can use it!

  • Dictionaries in Swift Explained

    Dictionaries in Swift Explained
    July 5 2020 in App Development A dictionary is a fundamental component in Swift programming. With a dictionary you can store key-value data in your app. It's a collection type, similar to an array. In this article you'll learn how to use dictionaries, and much more!

  • Arrays in Swift Explained

    Arrays in Swift Explained
    July 5 2020 in App Development Arrays are fundamental building blocks of apps. They're crucial to mastering iOS development. In this article you'll learn how you can use arrays in your Swift code. Let's get started!

  • Tuples Explained in Swift

    Tuples Explained in Swift
    July 1 2020 in App Development Tuples may look small, but they're quite powerful! You use tuples in Swift to make ordered, comma-separated lists of values. In this article, we'll discuss how you can use tuples in practical iOS development. Let's get to it!

  • How To Keep Up with Swift Changes

    How To Keep Up with Swift Changes
    June 22 2020 in App Development How do you deal with Swift changes as you’re learning how to code iOS apps? It’s a frustration that many beginner iOS developers share. How do you keep up, avoid learning outdated information, and stay up-to-date on latest developments? We’ll find out in this article!

  • Generics in Swift Explained

    Generics in Swift Explained
    June 15 2020 in App Development Generics are a super powerful feature of Swift. This article explains how generics work, including generic types and protocols, and why they're awesome. Let's get started!

  • Off-By-One Errors In Swift Programming

    Off-By-One Errors In Swift Programming
    May 15 2020 in App Development Off by one errors, like "Array index out of range", happen in programming when we've got the boundaries of things wrong. In this article, you'll learn what an off-by-one error is and how you can solve it with Swift programming.

  • Learn Swift Programming The Simple Way

    Learn Swift Programming The Simple Way
    April 20 2020 in App Development Swift is an easy to learn programming language for iOS, macOS, and more. Learning how to code Swift is simple, a lot of fun, and you can build awesome apps with it! In this article, we'll discuss simple approaches to learn Swift coding.

  • Computed Properties Explained in Swift

    Computed Properties Explained in Swift
    April 3 2020 in App Development A computed property is a property that calculates and returns a value, rather than just store it. In this tutorial, we'll discuss how computed properties work and how you can use them in your day-to-day iOS development.

  • Initializers & init() Explained in Swift

    Initializers & init() Explained in Swift
    March 24 2020 in App Development An initializer is a function we use to construct objects in Swift. In this article, we're going to discuss how initializers work, why they're needed, and how you can write your own. We'll focus on the different kinds of initializers, such as convenience initializers, what the consequences are of subclassing, errors you may face in day-to-day iOS development, and much more.

  • Dates, DateComponents and Formatting in Swift

    Dates, DateComponents and Formatting in Swift
    March 16 2020 in App Development How do you work with date and time in Swift? In this tutorial, we'll discuss how you can convert date/time to strings, and vice versa, how date/time formatting works, how to calculate time durations, and much more.

  • The Ultimate Guide to Closures in Swift

    The Ultimate Guide to Closures in Swift
    March 9 2020 in App Development Closures are blocks of code that you can pass around in your code, as if you assign a function to a variable. They also capture their surrounding scope. Closures are elegant, powerful, and crucial for mastering iOS development. Let's dive in!

  • Play With Code: Palindromes In Swift

    Play With Code: Palindromes In Swift
    February 2 2020 in App Development The date 02-02-2020 is a palindrome. Palindromes are words that read the same forward as backward. And they're great fun to play with in Swift! In this article, we'll discuss and code 3 approaches to check if a string is a palindrome in Swift.

  • Access Control Explained In Swift

    Access Control Explained In Swift
    December 6 2019 in App Development In Swift, access control is used to restrict parts of your app's source code by defining public and private APIs. It's an important aspect of Swift development. Let's find out how it works!

Reinder de Vries

Hi, I'm Reinder.
I help developers play with code.

Get the Weekly

Get iOS/Swift tutorials and insights in your inbox, every Monday.
  • This field is for validation purposes and should be left unchanged.

Most Popular

Browse Topics

Swift Sandbox

Code Swift right in your browser!
Go to the Swift Sandbox