<!--
{
  "availability" : [
    "iOS: 8.0 -",
    "iPadOS: 8.0 -",
    "macCatalyst: 13.0 -",
    "macOS: 10.10 -",
    "tvOS: 9.0 -",
    "visionOS: 1.0 -",
    "watchOS: 2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "Swift"
  },
  "title" : "Swift"
}
-->

# Swift

Build apps using a powerful open language.

## Overview

Swift includes modern features like type inference, optionals, and closures, which
make the syntax concise yet expressive. Swift ensures your code is fast and efficient,
while its memory safety and native error handling make the language safe by design.
Writing Swift code is interactive and fun in Swift Playgrounds, playgrounds in Xcode,
and REPL.

```swift
var interestingNumbers = [
    "primes": [2, 3, 5, 7, 11, 13, 17],
    "triangular": [1, 3, 6, 10, 15, 21, 28],
    "hexagonal": [1, 6, 15, 28, 45, 66, 91]
]

for key in interestingNumbers.keys {
    interestingNumbers[key]?.sort(by: >)
}

print(interestingNumbers["primes"]!)
// Prints "[17, 13, 11, 7, 5, 3, 2]"
```

### Learn Swift

If you’re new to Swift, read [The Swift Programming Language](https://docs.swift.org/swift-book/)
for a quick tour, a comprehensive language guide, and a full reference manual. If
you’re new to programming, check out [Swift Playgrounds](https://www.apple.com/swift/playgrounds/)
on iPad.

Swift is developed in the open. To learn more about the open source Swift project
and community, visit [Swift.org](https://swift.org).

## Topics

### Essentials

  <doc://com.apple.documentation/documentation/Updates/Swift>

  <doc://com.apple.Swift/documentation/Swift/AdoptingSwift6>

### Standard Library

[`Int`](/documentation/Swift/Int)

A signed integer value type.

[`Double`](/documentation/Swift/Double)

A double-precision (64-bit), floating-point value type.

[`String`](/documentation/Swift/String)

A Unicode string value that is a collection of characters.

[`Array`](/documentation/Swift/Array)

An ordered, random-access collection.

[`Dictionary`](/documentation/Swift/Dictionary)

A collection whose elements are key-value pairs.

  <doc://com.apple.Swift/documentation/Swift/swift-standard-library>

### Observation

[`Observation`](/documentation/Swift#Observation)

### Distributed Actors

[`Distributed`](/documentation/Distributed)

### Regular Expression DSL

[`RegexBuilder`](/documentation/RegexBuilder)

### Low-Level Atomic Operations

[`Synchronization`](/documentation/Synchronization)

### Data Modeling

  <doc://com.apple.Swift/documentation/Swift/choosing-between-structures-and-classes>

  <doc://com.apple.Swift/documentation/Swift/adopting-common-protocols>

### Data Flow and Control Flow

  <doc://com.apple.Swift/documentation/Swift/maintaining-state-in-your-apps>

  <doc://com.apple.Swift/documentation/Swift/preventing-timing-problems-when-using-closures>

### Language Interoperability with Objective-C and C

  <doc://com.apple.Swift/documentation/Swift/objective-c-and-c-code-customization>

  <doc://com.apple.Swift/documentation/Swift/migrating-your-objective-c-code-to-swift>

  <doc://com.apple.Swift/documentation/Swift/cocoa-design-patterns>

  <doc://com.apple.Swift/documentation/Swift/handling-dynamically-typed-methods-and-objects-in-swift>

  <doc://com.apple.Swift/documentation/Swift/using-objective-c-runtime-features-in-swift>

  <doc://com.apple.Swift/documentation/Swift/imported-c-and-objective-c-apis>

  <doc://com.apple.Swift/documentation/Swift/calling-objective-c-apis-asynchronously>

### Language Interoperability with C++

  <doc://com.apple.Swift/documentation/Swift/MixingLanguagesInAnXcodeProject>

  <doc://com.apple.Swift/documentation/Swift/CallingAPIsAcrossLanguageBoundaries>



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)
