Swift Tutorial · Swift Basics · Lesson 1 of 30
Swift Introduction
What Swift is, where it's used (iOS, macOS, servers, Linux), and what a Swift program looks like.
What is Swift?
Swift is a fast, safe, modern language created by Apple. It's the main language for apps on iPhone,
iPad, Mac, Apple Watch, Apple TV and Vision Pro, and it's open source, so it also runs on Linux, Windows,
Android and servers. Swift catches many mistakes at compile time: values can't be nil unless their type says
so, and the Swift 6 language mode rejects data races.
Hello, World!
print("Hello, World!")
let language = "Swift"
print("Welcome to \(language)")
Output
Hello, World! Welcome to Swift
Run this on your computer — see “Get Started” for setup.
In a main.swift file (or a playground) code runs from top to bottom; there's no main function to write and no
semicolons. The examples on this site show the program and its output; each was compiled with the Swift 6.4
compiler and run.
Test yourself
Which company created Swift?
GoogleJetBrainsAppleMicrosoft
Show answer
Answer: Apple