-
Tailor macOS windows with SwiftUI
Make your windows feel tailor-made for macOS. Fine-tune your app's windows for focused purposes, ease of use, and to express functionality. Use SwiftUI to style window toolbars and backgrounds. Arrange your windows with precision, and make smart decisions about restoration and minimization.
Capítulos
- 0:53 - Anatomy of a window
- 1:53 - App window structure
- 2:41 - Style window toolbars
- 3:53 - Refine window behaviors
- 5:55 - Adjust window placement
Recursos
- Customizing window styles and state-restoration behavior in macOS
- Windows
- Forum: UI Frameworks
- Destination Video
Vídeos relacionados
WWDC24
WWDC22
-
Buscar neste vídeo...
-
-
3:11 - Style Toolbars - Removing Title
.toolbar(removing: title) -
3:14 - Style Toolbars - Removing Toolbar Background
.toolbarBackgroundVisibility(.hidden, for: .windowToolbar) -
4:33 - Refine Behaviors - Adding Container Background
.containerBackground(.thickMaterial, for: .window) -
5:13 - Refine Behaviors - Minimize Behavior
.windowMinimizeBehavior(.disabled) -
5:44 - Refine Behaviors - Restoration Behavior
.restorationBehavior(.disabled) -
7:11 - Adjust Placement - Default Placement
.defaultWindowPlacement { content, context in var size = content.sizeThatFits(.unspecified) let displayBounds = context.defaultDisplay.visibleRect // modify size based on display bounds return WindowPlacement(size: size) } -
8:35 - Adjust Placement - Ideal Placement
.windowIdealPlacement { content, context in var size = content.sizeThatFits(.unspecified) let displayBounds = context.defaultDisplay.visibleRect // modify size based on display bounds return WindowPlacement(size: size) } -
9:48 - Borderless Window
.windowStyle(.plain) -
9:53 - Default Launch Behavior
.defaultLaunchBehavior(.presented)
-