Docs Hub
Documentation/Languages

Swift

What is Swift?

Swift is a modern programming language developed by Apple. It was introduced in 2014 as a safer, faster, and more beginner-friendly alternative to Objective-C — the older language used to build apps for Apple platforms.

You can use Swift to build apps for:

iOS (iPhone and iPad)
macOS
watchOS (Apple Watch)
tvOS (Apple TV)
visionOS (Apple Vision Pro)

It’s also open source, which means you can use Swift even outside of Apple’s ecosystem — like on Linux or server-side development.

  1. What does Swift code look like?

Here’s a very simple Swift program:

let name = "World"
print("Hello, \(name)!")

It declares a constant called name and prints out a greeting. Swift is designed to be readable, easy to write, and safe — things like null-pointer exceptions and unsafe memory access are much harder to do in Swift.

You don’t need semicolons. You don’t need to manually allocate memory. It just works.

On this page