Getting Started

Installing Swift

If you don’t have Swift installed, install it first.

To test that you have Swift installed, run swift --version from your shell or terminal app.

Swift comes bundled with the Swift Package Manager (SwiftPM), which manages the distribution of your Swift code, and allows easy importing of other Swift packages into your apps.

Using Swift

Here are some examples of the many use cases of Swift, in case you want to jump in and start writing some code right away.

  • Command-line Tool

    Learn how to create cross-platform command-line tools such as short-lived interactive programs, or long-lived daemons that run in the background.

    Start tutorial
  • Library

    Learn how to create a cross-platform library for sharing reusable code, or modularize large code-base.

    Start tutorial
  • Web Service

    Learn how to create a web service using a web framework.

    This guide requires macOS or Linux.

    Start tutorial
  • iOS and macOS Application

    Learn how to create an iOS or macOS application using SwiftUI.

    This guide requires macOS and Xcode.

    Start tutorial

Looking for a language reference? The Swift Programming Language (TSPL) book is available in multiple languages.

Go Further

Ready to dive deeper? Here are some hand-picked resources covering various Swift features.

  • Value and Reference Types

    This article describes the differences in behavior between value types and reference types—a fundamental part of learning Swift and choosing between structures and classes.

    Read article
  • Generics

    In Swift, generics are a fundamental way to write abstract code. This video walks through the basics of Swift Generics and introducing generics into your code.

    Watch video
  • Concurrency

    Swift has concurrency features built into the language making it easier to write concurrent code with the assistance of the compiler. This video introduces the async/await mechanism, a key part of Swift Concurrency.

    Watch video
  • Regular Expressions

    Swift provides first-class regular expression support, commonly known as regex, for effective string processing. This video gives an overview of the power and flexibility of Swift Regex.

    Watch video
  • Wrapping C/C++ Library in Swift

    This article describes how to wrap a C or C++ library in Swift.

    Read article

Looking for even more? In the documentation you can find resources, references, and guidelines related to the Swift project, including the API Design Guidelines.