iOS 27 delivers a sweeping set of SwiftUI enhancements including Liquid Glass design, a new Document API with async read/write, toolbar visibility controls, and iPhone app resizability. These changes touch nearly every layer of a SwiftUI app.
β’ Liquid Glass design is adopted automatically β no code changes required β but new APIs let you fine-tune tinting, interactivity, and active/inactive appearance
β’ The new Document API brings async, incremental disk I/O with snapshot diffing and progress reporting, dramatically improving performance for document-based apps
β’ New toolbar APIs (visibilityPriority, ToolbarOverflowMenu, topBarPinnedTrailing, toolbarMinimizeBehavior) give developers precise control over adaptive toolbars across resizable iPhone, iPad, and Mac windows
Demonstrates the new toolbar visibility APIs and the WritableDocument async snapshot pattern introduced in iOS 27, showing how to keep critical actions visible and write documents efficiently in the background.
import SwiftUI
import UniformTypeIdentifiers
// MARK: - Document Model
struct PageSnapshot {
let text: String
let timestamp: Date
}
@Observable
final class NoteDocument: WritableDocument, ReadableDocument {
var text: String = ""
// MARK: WritableDocument
static var writableContentTypes: [UTType] { [.plainText] }
func snapshot() throws -> PageSnapshot {
PageSnapshot(text: text, timestamp: Date())
}
func makeWriter() -> some DocumentWriter<PageSnapshot> {
NoteWriter()
}
// MARK: ReadableDocument
static var readableContentTypes: [UTType] { [.plainText] }
func apply(_ snapshot: PageSnapshot) {
text = snapshot.text
}
func makeReader() -> some DocumentReader<PageSnapshot> {
NoteReader()
}
}
struct NoteWriter: DocumentWriter {
typealias Snapshot = PageSnapshot
nonisolated func write(
_ snapshot: PageSnapshot,
to url: URL,
previousSnapshot: PageSnapshot?,
progress: Foundation.Progress
) async throws {
// Only write if content actually changed
guard snapshot.text != previousSnapshot?.text else {
progress.completedUnitCount = 1
return
}
let data = Data(snapshot.text.utf8)
try data.write(to: url, options: .atomic)
progress.completedUnitCount = 1
}
}
struct NoteReader: DocumentReader {
typealias Snapshot = PageSnapshot
nonisolated func read(from url: URL) async throws -> PageSnapshot {
let data = try Data(contentsOf: url)
let text = String(decoding: data, as: UTF8.self)
return PageSnapshot(text: text, timestamp: Date())
}
}
// MARK: - App Entry Point
@main
struct NoteApp: App {
var body: some Scene {
DocumentGroup(newDocument: NoteDocument()) { file in
NoteEditorView(document: file.document)
}
}
}
// MARK: - Editor View with New Toolbar APIs
struct NoteEditorView: View {
@Bindable var document: NoteDocument
var body: some View {
ScrollView {
TextEditor(text: $document.text)
.padding()
}
// Scroll down hides the nav bar to reclaim space
.toolbarMinimizeBehavior(.onScrollDown, for: .navigationBar)
.toolbar {
// High-priority group: always visible
ToolbarItemGroup(placement: .topBarLeading) {
Button("Undo", systemImage: "arrow.uturn.backward") {}
Button("Redo", systemImage: "arrow.uturn.forward") {}
}
.visibilityPriority(.high)
// Always pinned to trailing edge
ToolbarItem(placement: .topBarPinnedTrailing) {
ShareLink(item: document.text)
}
// Lower-priority actions go into overflow menu
ToolbarOverflowMenu {
Button("Export as PDF", systemImage: "doc.richtext") {}
Button("Clear All", systemImage: "trash", role: .destructive) {}
}
}
.navigationTitle("My Note")
}
}The new DocumentGroup/WritableDocument/ReadableDocument APIs replace the older FileDocument/ReferenceFileDocument patterns β migration is recommended but the old protocols remain available. The write method being nonisolated async means you must be careful about data races when accessing document state. toolbarMinimizeBehavior is only meaningful for scrollable content and may not work as expected with non-scrolling views.
Liquid Glass appearance requires 2027 hardware releases for full visual fidelity; Document API improvements are available on all supported platforms
More iOS 27 APIs land every week.
Get notified when new capabilities are published β no noise, just signal.