iOS 27 adds sectioned queries, codable model attributes, ResultsObserver for non-SwiftUI change observation, and HistoryObserver for reacting to persistent history changes in SwiftData.
β’ Added sectionBy parameter to @Query for sectioned SwiftUI lists without manual grouping
β’ Added .codable attribute option to persist Codable class types from external frameworks
β’ Introduced ResultsObserver β a Swift Observation-based alternative to @Query usable outside SwiftUI views
β’ Introduced HistoryObserver to reactively monitor SwiftData persistent history transactions, filterable by model type and author
β’ ResultsObserver lets any Swift class (not just SwiftUI views) reactively observe store changes using Swift Observation, unlocking SwiftData in game engines, state machines, and service layers
β’ Codable attributes provide an escape hatch to persist third-party class types (e.g. MKMapItem.Identifier) that SwiftData can't auto-inspect
β’ HistoryObserver makes server sync and cross-process change propagation straightforward without manual history polling
Demonstrates ResultsObserver in a non-SwiftUI class that recalculates map camera bounds whenever Trip data changes in the SwiftData store.
import SwiftData
import MapKit
import Observation
@Model
final class Trip {
var name: String
var destination: String
var latitude: Double
var longitude: Double
var startDate: Date
var endDate: Date
init(name: String, destination: String, latitude: Double, longitude: Double, startDate: Date, endDate: Date) {
self.name = name
self.destination = destination
self.latitude = latitude
self.longitude = longitude
self.startDate = startDate
self.endDate = endDate
}
}
@Observable
final class MapCameraController {
var cameraBounds: MapCameraBounds = MapCameraBounds(centerCoordinateBounds: .world)
private var observer: ResultsObserver<Trip>
private var observationToken: ObservationTracking.Token?
init(modelContainer: ModelContainer) {
// ResultsObserver works like @Query but outside SwiftUI views
observer = ResultsObserver<Trip>(
modelContainer: modelContainer,
sortBy: [SortDescriptor(\.startDate)]
)
// withContinuousObservation + .didSet fires after each change settles
observationToken = withContinuousObservation(options: .didSet) { [weak self] in
guard let self else { return }
// Accessing results registers the dependency with Swift Observation
_ = self.observer.results
self.recalculateBounds()
}
}
private func recalculateBounds() {
let trips = observer.results
guard !trips.isEmpty else {
cameraBounds = MapCameraBounds(centerCoordinateBounds: .world)
return
}
let coords = trips.map {
CLLocationCoordinate2D(latitude: $0.latitude, longitude: $0.longitude)
}
let region = MKCoordinateRegion(coordinates: coords)
cameraBounds = MapCameraBounds(centerCoordinateBounds: region)
}
}
// MARK: - SwiftUI integration
import SwiftUI
struct TripMapView: View {
@State private var controller: MapCameraController
init(modelContainer: ModelContainer) {
_controller = State(initialValue: MapCameraController(modelContainer: modelContainer))
}
var body: some View {
Map(bounds: controller.cameraBounds)
}
}USDKit is a new first-party Swift framework introduced in iOS/macOS 27 that brings native USD scene creation, composition, modification, and export capabilities to Apple platform apps, with deep RealityKit and Spatial Preview integration.
The NowPlaying framework introduces a first-class Swift API for surfacing app media in system-wide now-playing surfaces β Lock Screen, Control Center, Dynamic Island, StandBy, CarPlay, Apple Watch, and Apple TV β via a declarative MediaSessionRepresentable protocol. It also supports remote media sessions (for controlling external speakers/TVs) and Media Sharing Extensions for routing media to third-party devices.
LiveCommunicationKit is the modern replacement for CXProvider that delivers rich, native conversation UIs integrated with the Lock Screen, Dynamic Island, Phone app Recents, and Siri. It provides a unified lifecycle model for audio and video conversations with a single delegate-driven action pipeline.
In-depth guide
iOS 26 β iOS 27 Migration Guide βCodable attributes are opaque to SwiftData β they cannot be used in Predicates or SortDescriptors, and schema changes to the underlying Codable type won't trigger migrations. ResultsObserver and HistoryObserver require storing the ObservationTracking token to keep observation alive. Sectioned Query sections are accessed via the underscore-prefixed property wrapper (_trips), not the projected value.
None
Xcode 27 introduces an agentic localization workflow that lets you ask a coding agent to translate your entire app directly inside Xcode, leveraging String Catalog context β including where and how strings are used β to produce accurate, consistent translations across all languages.