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!


  • Weak vs. Strong References in Swift

    Weak vs. Strong References in Swift
    October 21 2020 in App Development Creating a strong reference to an instance in Swift, means that the instance is kept in the iPhone's memory until you're done with it. You can also create weak references. Both are part of the memory management mechanism called ARC. In this tutorial, we'll discuss how weak and strong references work on iOS with Swift.

  • Automatic Reference Counting (ARC) in Swift

    Automatic Reference Counting (ARC) in Swift
    October 15 2020 in App Development Automatic Reference Counting (ARC) is a mechanism to manage memory in Swift. Working with ARC concepts is essential in day-to-day iOS development. In this tutorial, we'll discuss how ARC is used to manage memory on iOS.

  • Self and self in Swift

    Self and self in Swift
    October 8 2020 in App Development In Swift, "self" typically refers to the current object within a class or struct. But there's more: "self", "Self" and even ".self". How does that work? Get ready for some introspection and metaprogramming, as we discover The Self in Swift!

  • Keypaths in Swift Explained

    Keypaths in Swift Explained
    October 5 2020 in App Development With keypaths in Swift, you're referencing a property, as opposed to its value. You can pass these keypaths around in your code, and create all sorts of metaprogramming mayhem with it. Let's find out more!

  • Working with Files on iOS with Swift

    Working with Files on iOS with Swift
    October 1 2020 in App Development You use FileManager to work with files and directories on iOS. It's a Swift API that helps you read from, and write to, various data and file formats. In this tutorial, you learn how to work with files on iOS with Swift.

  • Storing Data with NSCoding and NSKeyedArchiver

    Storing Data with NSCoding and NSKeyedArchiver
    September 27 2020 in App Development You can use NSCoding and NSKeyedArchiver to save and load simple data objects with Swift. It's perfect for scenarios when you don't need a more complex tool, like Core Data. Let's dive in!

  • Strings in Swift Explained

    Strings in Swift Explained
    September 22 2020 in App Development You use strings in Swift to represent text. They're strings of characters, use the String value type, and are stored with the intriguing Unicode/UTF-8 data format. Let's find out more about strings in Swift!

  • Ranges in Swift Explained

    Ranges in Swift Explained
    September 9 2020 in App Development You use ranges in Swift to define values between a lower and upper limit. Ranges are useful for creating slices of arrays, checking if a value is contained in a range, and much more. Let's find out how they work!

  • Random Numbers in Swift

    Random Numbers in Swift
    August 14 2020 in App Development Let's take a look at random numbers and their functions in Swift. How do you use them? What are they for? Let's find out!

  • Playing With Code: Insertion Sort in Swift

    Playing With Code: Insertion Sort in Swift
    August 6 2020 in App Development Let's play with code! Today, we'll discuss a sorting algorithm called insertion sort. And we'll build it step-by-step in Swift. It's interesting to see how sorting works exactly, and good practice to code it ourselves. Let's get started!

  • How To Generate a Random Unique Identifier with UUID in Swift

    How To Generate a Random Unique Identifier with UUID in Swift
    August 6 2020 in App Development Universally unique IDs are very useful in Swift. How do you generate them? And how do they work behind-the-scenes? Let's dive into the world of RFCs, UUID and big numbers...

  • Convert String to Int (and Back) in Swift

    Convert String to Int (and Back) in Swift
    August 6 2020 in App Development You can't fit a round peg in a square hole. But you can convert from String to Int, and vice versa! And it depends on the size of the peg, really. Well... let's find out if the article is better than this cheesy intro!

  • Extensions in Swift Explained

    Extensions in Swift Explained
    August 6 2020 in App Development Extensions in Swift are super powerful, because they help you organize your code better. You use an extension to add new functionality to an existing class. Let's find out how!

  • How To: Working with Plist in Swift

    How To: Working with Plist in Swift
    August 6 2020 in App Development A property list, or plist, is an XML file that contains basic key-value data. You can use a plist in your iOS apps as a simple key-value data store. Let's find out how that works!

  • How To Find an Item in an Array in Swift

    How To Find an Item in an Array in Swift
    August 6 2020 in App Development How do you find an item in an array in Swift? Let's find out! In this article you'll learn how to use the various generic functions to find matching items in an array.

  • Switch Statements in Swift Explained

    Switch Statements in Swift Explained
    August 5 2020 in App Development In this article you learn how to use the switch statement in Swift. With switch you can inspect a value and match it with a number of cases. Let's get to it!

  • Enums in Swift Explained

    Enums in Swift Explained
    August 5 2020 in App Development With Swift's enums you can organize groups of values that are related. They're perfect for managing state in your app, and you can use them in a type-safe way in your code. Let's find out how they work!

  • Let's Solve The FizzBuzz Challenge in Swift

    Let's Solve The FizzBuzz Challenge in Swift
    August 5 2020 in App Development FizzBuzz is a legendary coding challenge. You simply must give it a try! But... what approaches can you use to solve FizzBuzz with the Swift programming language?

  • Lazy Computed Properties in Swift

    Lazy Computed Properties in Swift
    August 5 2020 in App Development Lazy computed properties are super useful in Swift programming. But you can't just make any computed property lazy. How do you get around that? Learn how to use lazy computed properties in this article. Enjoy!

  • Delegation in Swift Explained

    Delegation in Swift Explained
    August 5 2020 in App Development Delegation, also known as the Delegate pattern, is frequently used in practical iOS development. It's a must-have in your iOS developer's toolbox, and in this tutorial we're going to figure out how delegation works.

  • Protocols in Swift Explained

    Protocols in Swift Explained
    August 5 2020 in App Development Protocols are prominently used in Swift. What makes them so elegant and powerful? In this article you'll learn how to work with protocols in Swift and why they are useful for practical iOS development.

  • Conditionals in Swift with If, Else If, Else

    Conditionals in Swift with If, Else If, Else
    August 4 2020 in App Development In Swift you use conditionals to make decisions in your code, with if, else if and else. If this happens, then do that. In this article you'll learn how to use conditionals in your Swift code. We'll get into boolean logic, expressions, operators, and the syntax of if, else if and else blocks. Let's get started!

  • 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!

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