页面简介
Swift 6.2 concurrency relaxations, Liquid Glass design system, Xcode 27 improvements, and platform features across iOS 27, macOS 27, and visionOS 27, from the non-AI half of WWDC26.
正文摘录
WWDC26's AI announcements got most of the coverage, but the non-AI stack is larger and touches every Apple platform developer whether they use AI or not. Swift 6.2 makes concurrency opt-in by default — a single compiler flag turns your module into a single-threaded program until you explicitly reach for parallelism. Liquid Glass rolls out across every Apple platform, and while standard components adopt it automatically, custom UI needs an explicit opt-in. macOS 27 gains a native OCI container CLI and open-source Containerization framework, the first time Apple has shipped first-party Linux container tooling. Below that: iOS 27 extends swipe actions and drag-to-reorder to any SwiftUI container, visionOS 27 ships cloth simulation and a foveated streaming API for cloud content, and Metal gains neural rendering pipelines that enable GPU-side ML inference without CPU round-trips. If you're deciding what to prioritise from WWDC26's non-AI announcements, here's the developer-focused rundown by platform tier. What's new at WWDC26 for platform developers (quick reference) Liquid Glass design system Available on iOS 27, iPadOS 27, macOS 27, watchOS 27, visionOS 27 Liquid Glass is a new translucent, fluid material rolling out across all Apple platforms. Standard components adopt it automatically, but custom views need explicit opt-in via SwiftUI modifiers. What's new for developers: Standard SwiftUI components (buttons, tab bars, sheets) adopt Liquid Glass automatically with no code changes .glassEffect() — apply to any custom view; default shape is a Capsule .glassEffect(in: .rect(cornerRadius: 16.0)) — use a custom shape .glassEffect(.regular.tint(.orange).interactive()) — tinted glass that reacts to touch and pointer like a standard button GlassEffectContainer(spacing:) — group multiple glass views for better rendering performance and shape morphing .glassEffectUnion(id:namespace:) — merge several views into a single glass shape at rest GlassButtonStyle / .buttonStyle(.glass) — ready-made glass button appearance Two transition types: .matchedGeometry (shapes morph into each other when within the container's spacing threshold) and .materialize (simpler appear/disappear for views farther apart) Performance note: apply .glassEffect() after other appearance modifiers; too many ungrouped effects or containers degrades rendering How glass morphing works GlassEffectContainer(spacing:) is the key to fluid animations. When two glass-effect views are closer together than the container's spacing value, their shapes begin to blend at rest. Animate a view in or out and the shapes morph smoothly, merging as they approach and separating as they pull apart. Use .glassEffectID(_:in:) with a @Namespace to associate specific shapes across transitions, so SwiftUI animates the correct pairs when views appear or disappear from the hierarchy. Swift 6.2 and SwiftUI Swift 6.2 released September 2025; SwiftUI changes ship with OS 27 Swift 6.2's biggest change is a single compiler flag that turns your whole module into a single-threaded program until you explicitly opt in to parallelism, making concurrency approachable for the first time without rewriting existing code. Swift 6.2 concurrency changes -default-isolation MainActor compiler flag: the entire module runs on the main actor by default; external modules are unaffected, and URLSession and other async work still runs off the main thread nonisolated async functions now run on the caller's actor (SE-0461); to get the old off-actor behaviour, mark the function @concurrent Task.immediate {}: starts executing synchronously if already on the target executor, unlike a regular Task which queues to the next opportunity isolated deinit: safely access actor-isolated state in a deinit; required for main-actor classes that need to clean up non-Sendable properties Task naming: Task(name: "MyTask") {} — name appears in LLDB debugger and profiling tools via Task.name The practical effect: new app targets in Xcode 27 can now default to Swift 6 language mode without concurrency warnings flooding existing code. Swift 6.2 language additions Raw identifiers (SE-0451): backtick any identifier name, including spaces and numbers — func `Strip HTML tags from string`() or case \404`` in an enum Typed string interpolation default (SE-0477): "\(age, default: "Unknown")" works across mismatched types, unlike ?? which requires matching types InlineArray (SE-0453): fixed-size, stack-allocated array — InlineArray<4, String> or the shorthand [4 of String]; no append() or remove(at:), iterate via indices weak let (SE-0481): immutable weak reference; enables Sendable conformance on types that hold weak properties Method key paths (SE-0479): strings.map(\.uppercased()) enumerated() as Collection (SE-0459): use directly in SwiftUI — List(items.enumerated(), id: \.offset) { ... } Swift Testing in 6.2 adds exit tests (await #expect(processExitsWith: .failure) {}), test attachments (Attachment.record(result, named: "Label")), and raw identifier test names. SwiftUI updates for OS 27 Swipe actions and drag-to-reorder, previously limited to List, now work on any container. .swipeActionsContainer() on the parent + .swipeActions {} on any child view — works in ScrollView, LazyVStack, custom layouts .reorderable() on items + .reorderContainer(for: T.self) { difference in difference.apply(to: &items) } on the parent .navigationTransition(.crossFade) — joins .zoom as a built-in navigation transition Tab(role: .prominent) — trailing-separated tab, similar to search AsyncImage now caches automatically via HTTP caching protocols; customise with .asyncImageURLSession(session) on a parent view New toolbar APIs: placement: .topBarPinnedTrailing, ToolbarOverflowMenu {}, .visibilityPriority(.high) @State is now a Swift macro, avoiding repeated evaluation of the initial expression on view re-instantiation; back-deploys to iOS 17-aligned OSes iOS 27 platform APIs Available on iOS 27, iPadOS 27 iOS 27 and iPadOS 27 ship updates across commerce, health, writing tools, and camera that are individually targeted but collectively affect most production apps. StoreKit: offer code redemption now returns VerificationResult<Transaction>; new Product.ProductType for subscription Bundles and Suites; Transaction.OwnershipType.assigned for volume purchases HealthKit: two new Reproductive Health sample types — HKCategoryTypeIdentifierMenopausalState (values: menopause, perimenopause, none) and HKCategoryTypeIdentifierBleedingAfterMenopause MetricKit: new Swift-first MetricManager API with AsyncStream of MetricReport and DiagnosticReport; new MetalFrameRateMetric per CAMetalLayer; old MXMetricManager is deprecated Background Assets: localized asset packs deliver the right language assets automatically; On Demand Resources and NSBundleResourceRequest are now deprecated — migrate to Background Assets Camera: high-resolution photo capture improvements, Center Stage front camera support UIKit: apps built with the iOS 27 SDK must include a launch screen, and scene-based life cycle is now required — apps without it fail to launch Shortcuts: updated APIs (session: "What's new in Shortcuts") CarPlay: updated CPNavigationSession and CPMapPanel APIs (session: "Rev up your CarPlay app", 5.6k views) PaperKit for iPad PaperKit is a new iPadOS 27 framework for a paper-like writing surface, distinct from PencilKit's drawing canvas. Where PencilKit gives you a canvas for capturing and manipulating strokes, PaperKit is the surface itself: the feel of writing on paper in note-taking and writing apps. Full API details are in the "Unwrap PaperKit" WWDC26 session. macOS 27 Available on macOS 27 (Tahoe) macOS 27's most developer-significant addition is a native OCI container CLI and open-source Containerization framework, the first time Apple has shipped first-party Linux container tooling. Container machines Apple announced two separate things, and the distinction matters: Containerization framework: a general-purpose Swift framework that could be adopted as a backend by Docker or other tools container CLI: an OCI-compliant command-line tool for running Linux containers; not a Docker replacement The architecture uses a VM-per-container model via macOS Virtualization.framework, with each container getting its own Kata Containers Linux kernel. Everything is written in Swift (no Go), with Protobuf for daemon communication. Container startup is around 0.7 seconds. Key details: Open source at github.com/apple/container container system start to initialise the daemon, then container run alpine uname -a No macOS containers, no iOS containers, no GPU passthrough (yet) Image unpack is slower than Docker for large images Missing quality-of-life features Docker and OrbStack have — Docker is not directly threatened at this stage The VM-per-container model provides more isolation than Docker's single-VM approach, making it potentially better for production multitenant workloads, but more memory-intensive for a typical dev environment running several services at once. Safari and WebKit 27 1,000+ browser engine improvements CSS Grid Lanes Customizable <select> element HTML <model> element for inline 3D spatial content in web pages Build Safari web extensions with Xcode Cloud — no Mac required visionOS 27 Available on visionOS 27 visionOS 27 extends RealityKit with physically-accurate rendering features, ships a new foveated streaming API for cloud content, and upgrades object tracking to 90 Hz. Physical space lighting: virtual objects cast light onto physical surfaces in the room Projective Textures API: apply textures to spotlights for effects like stained glass or underwater caustics Real-time cloth simulation: physics-based simulation for flags, curtains, and clothing Reverb Mesh API: spatial audio that models the acoustics of the actual physical room geometry 3D Gaussian Splat rendering: photorealistic scans of real-world objects (note: the Gaussian Splat Component API is listed