-
Add rich graphics to your SwiftUI app
Learn how you can bring your graphics to life with SwiftUI. We'll begin by working with safe areas, including the keyboard safe area, and learn how to design beautiful, edge-to-edge graphics that won't underlap the on-screen keyboard. We'll also explore the materials and vibrancy you can use in SwiftUI to create easily customizable backgrounds and controls, and go over graphics APIs like drawingGroup and the all new canvas. With these tools, it's simpler than ever to design fully interactive and interruptible animations and graphics in SwiftUI.
Recursos
- Add rich graphics to your SwiftUI app
- Composing SwiftUI gestures
- Adding interactivity with gestures
- GestureState
Videos relacionados
WWDC21
-
Buscar este video…
-
-
3:53 - Ignoring safe areas
// Ignore all safe areas ContentView() .ignoresSafeArea() // Ignore keyboard only ContentView() .ignoresSafeArea(.keyboard) -
7:08 - Foreground Styles
VStack { Text("Primary") .foregroundStyle(.primary) Text("Secondary") .foregroundStyle(.secondary) Text("Tertiary") .foregroundStyle(.tertiary) Text("Quaternary") .foregroundStyle(.quaternary) } -
7:35 - Purple Foreground Styles
VStack { Text("Primary") .foregroundStyle(.primary) Text("Secondary") .foregroundStyle(.secondary) Text("Tertiary") .foregroundStyle(.tertiary) Text("Quaternary") .foregroundStyle(.quaternary) } .foregroundStyle(.purple) -
7:41 - Blue Gradient Foreground Styles
let blueGradient = LinearGradient( colors: [.blue, .teal], startPoint: .leading, endPoint: .trailing) VStack { Text("Primary") .foregroundStyle(.primary) Text("Secondary") .foregroundStyle(.secondary) Text("Tertiary") .foregroundStyle(.tertiary) Text("Quaternary") .foregroundStyle(.quaternary) } .foregroundStyle(blueGradient)
-