Swift updates
Learn about important changes to Swift.
Overview
Browse notable changes in Swift. For information about Swift language changes, refer to The Swift Programming Language.
June 2025
Swift standard library
Safely access contiguous regions of memory, like a container’s underlying storage, using Span and RawSpan. Safely modify that memory using MutableSpan and MutableRawSpan.
Many collections in the standard library now have a
spanproperty that provides access to their underlying storage.Spanhas a bytes property to access the raw storage when the element type supports it.Process Unicode strings efficiently and safely, using UTF8Span to access a contiguous region of memory.
Create fixed-size arrays that have contiguous underlying storage using InlineArray.
To identify a task during debugging, you can set a name for a detached task using init(name:priority:operation:), and for a task in a task group using addTask(name:priority:operation:). Access the current task’s name using doc://com.apple.documentation/documentation/Swift/Task/name.
Start a task immediately using immediate(name:priority:executorPreference:operation:).
June 2024
Swift standard library
Operate on noncontiguous ranges in collections using RangeSet and DiscontiguousSlice.
Control which executor runs a task using TaskExecutor.
Validate that C strings contain well-formed Unicode text when converting to them to
Stringwith init(validatingCString:) and init(validating:as:).Preserve more information about thrown errors from AsyncSequence and AsyncIteratorProtocol using their
Failureassociated type.
See Also
Technology and frameworks
Accelerate updatesAccessibility updatesActivityKit updatesAdAttributionKit UpdatesApp Clips updatesApp Intents updatesAppKit updatesApple Intelligence updatesAppleMapsServerAPI UpdatesApple Pencil updatesARKit updatesAudio Toolbox updatesAuthenticationServices updatesAVFAudio updatesAVFoundation updates