---
title: Swift
framework: swift
role: collection
role_heading: Framework
path: swift
---

# Swift

Build apps using a powerful open language.

## Overview

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. 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 for a quick tour, a comprehensive language guide, and a full reference manual. If you’re new to programming, check out Swift Playgrounds on iPad. Swift is developed in the open. To learn more about the open source Swift project and community, visit Swift.org.

## Topics

### Essentials

- [Swift updates](updates/swift.md)
- [Adopting strict concurrency in Swift 6 apps](swift/adoptingswift6.md)

### Standard Library

- [Int](swift/int.md)
- [Double](swift/double.md)
- [String](swift/string.md)
- [Array](swift/array.md)
- [Dictionary](swift/dictionary.md)
- [Swift Standard Library](swift/swift-standard-library.md)

### Observation

- [Observation](observation.md)

### Distributed Actors

- [Distributed](distributed.md)

### Regular Expression DSL

- [RegexBuilder](regexbuilder.md)

### Low-Level Atomic Operations

- [Synchronization](synchronization.md)

### Data Modeling

- [Choosing Between Structures and Classes](swift/choosing-between-structures-and-classes.md)
- [Adopting Common Protocols](swift/adopting-common-protocols.md)

### Data Flow and Control Flow

- [Maintaining State in Your Apps](swift/maintaining-state-in-your-apps.md)
- [Preventing Timing Problems When Using Closures](swift/preventing-timing-problems-when-using-closures.md)

### Language Interoperability with Objective-C and C

- [Objective-C and C Code Customization](swift/objective-c-and-c-code-customization.md)
- [Migrating Your Objective-C Code to Swift](swift/migrating-your-objective-c-code-to-swift.md)
- [Cocoa Design Patterns](swift/cocoa-design-patterns.md)
- [Handling Dynamically Typed Methods and Objects in Swift](swift/handling-dynamically-typed-methods-and-objects-in-swift.md)
- [Using Objective-C Runtime Features in Swift](swift/using-objective-c-runtime-features-in-swift.md)
- [Imported C and Objective-C APIs](swift/imported-c-and-objective-c-apis.md)
- [Calling Objective-C APIs Asynchronously](swift/calling-objective-c-apis-asynchronously.md)

### Language Interoperability with C++

- [Mixing Languages in an Xcode project](swift/mixinglanguagesinanxcodeproject.md)
- [Calling APIs Across Language Boundaries](swift/callingapisacrosslanguageboundaries.md)

### Protocols

- [BorrowingIteratorProtocol](swift/borrowingiteratorprotocol.md)
- [BorrowingSequence](swift/borrowingsequence.md)

### Structures

- [BorrowingIteratorAdapter](swift/borrowingiteratoradapter.md)
- [SpanIterator](swift/spaniterator.md)

### Functions

- [withCheckedContinuation(function:_:)](swift/withcheckedcontinuation(function:_:).md)
- [withCheckedThrowingContinuation(function:_:)](swift/withcheckedthrowingcontinuation(function:_:)-13yf6.md)
- [withCheckedThrowingContinuation(function:_:)](swift/withcheckedthrowingcontinuation(function:_:)-2k46m.md)
- [withTaskCancellationHandler(operation:onCancel:)](swift/withtaskcancellationhandler(operation:oncancel:).md)
- [withTaskCancellationShield(operation:)](swift/withtaskcancellationshield(operation:)-2lzl8.md)
- [withTaskCancellationShield(operation:)](swift/withtaskcancellationshield(operation:)-8zlgh.md)
- [withUnsafeContinuation(_:)](swift/withunsafecontinuation(_:).md)
- [withUnsafeThrowingContinuation(_:)](swift/withunsafethrowingcontinuation(_:)-32nwt.md)
- [withUnsafeThrowingContinuation(_:)](swift/withunsafethrowingcontinuation(_:)-7zhvy.md)
