今日已更新 339 条资讯 | 累计 19899 条内容
关于我们

WWDC 2026 - What's New in SwiftUI - A Developer's Breakdown

ArshTechPro 2026年06月11日 17:53 6 次阅读 来源:Dev.to

WWDC26 brought a substantial round of updates to SwiftUI — not a ground-up redesign, but a lot of small limitations removed, new APIs that were clearly driven by real-world pain points, and meaningful performance improvements. This post walks through every major announcement so you know exactly what's available and when to reach for it. Look and Feel: Liquid Glass and the 2027 Releases The most immediately visible change costs you zero code. Apps built with SwiftUI automatically pick up the updated Liquid Glass appearance on the 2027 OS releases. The glass tint responds to the new system-level Liquid Glass slider without any changes on your part. On iPad, windows now dim when inactive, reinforcing which window has focus — again, automatic. On Mac, custom interactive Liquid Glass elements respond more fluidly to the mouse pointer. There are a few opt-in refinements available when you want tighter control: Responding to active state — use the appearsActive environment value to reduce opacity on custom elements when the window is inactive: struct SidebarFooterView : View { @Environment (\ . appearsActive ) private var appearsActive var body : some View { MyAccountView () . opacity ( appearsActive ? 1 : 0.5 ) } } Menu bar icons — the menu bar now shows a minimal set of icons by default. Add .labelStyle(.titleAndIcon) to a specific menu item to make its icon visible: CommandMenu ( "Stickers" ) { Button { openStore () } label : { Label ( "Store" , systemImage : "bag.fill" ) . labelStyle ( . titleAndIcon ) } } Resizability on iPhone iPhone apps become resizable on iOS 27, which matters for iPhone Mirroring and running iPhone apps on iPad. Xcode 27's Live Previews now include resize handles so you can test this interactively without running on a device. If your app mixes UIKit and SwiftUI, check the session "Modernize your UIKit app" for specifics around screen geometry, size classes, and orientation handling. Toolbar APIs The toolbar has been a source of friction on smalle

本文内容来源于互联网,版权归原作者所有
查看原文