SwSwift

Swift glossary – key terms explained

Actor

A reference type that protects its mutable state from concurrent access (isolation).

ARC

Automatic Reference Counting: Swift's memory management for classes; an object is freed when no strong reference exists anymore.

async/await

Syntax for asynchronous code: async marks functions that wait, await marks the places where they pause.

Closure

An anonymous block of code that captures values from its environment; e.g. { $0 * 2 }.

Enum with associated values

An enum whose cases carry their own data, e.g. case fehler(String).

Extension

Extends an existing type (even foreign ones like Int) with methods, computed properties, or protocol conformance.

Generics

Code with placeholder types (<T>), reusable for many types, with constraints such as T: Comparable.

guard

Checks a condition and leaves the scope immediately if it is not met; unwrapped values remain valid afterwards.

Optional

Type T?: either a value or nil. The compiler enforces handling the missing case.

Optional binding

if let / guard let safely unwraps an optional if it has a value.

Property wrapper

Encapsulates the access logic of a property with @propertyWrapper (e.g. @State, @AppStorage).

Protocol

Describes requirements for properties and methods; types “conform” to it, and extensions provide default implementations.

Reference type

A type where variables share the same instance (class, actor); managed by ARC.

Retain cycle

Two objects hold each other strongly and are never freed; solution: weak or unowned.

Sendable

A protocol for types that can be safely passed between concurrency domains.

Struct

A value type with properties and methods; the default choice for your own data types in Swift.

Swift Package Manager

Build and dependency tool integrated into Swift (Package.swift, swift build, swift test).

SwiftUI

Apple's declarative UI framework: views are structs that translate state into an interface.

Trailing closure

A closure as the last argument, written after the parentheses: liste.map { ... }.

Value type

A type that is copied on assignment (struct, enum, tuple, Int, String, Array).