-
What's new in AppKit
Discover the latest advances in Mac app development using AppKit. We'll take you through the latest updates to SF Symbols, show you how you can elevate your interface with enhanced controls, and help you learn to coordinate your windows with Stage Manager. We'll also explore the latest sharing and collaboration features for macOS.
Recursos
Videos relacionados
WWDC22
-
Buscar este video…
-
-
4:54 - Using the grouped form style in SwiftUI
enum AirDropVisbility: String, CaseIterable, Identifiable { case nobody = "No One" case contactsOnly = "Contacts Only" case everyone = "Everyone" var id: String { rawValue } var label: String { rawValue } var symbolName: String { switch self { case .nobody: return "person.crop.circle.badge.xmark" case .contactsOnly: return "person.2.circle" case .everyone: return "person.crop.circle.badge.checkmark" } } } struct ExampleFormView: View { @State private var name: String = "Mac Studio" @State private var screenSharingEnabled: Bool = true @State private var fileSharingEnabled: Bool = false @State private var airdropVisibility = AirDropVisbility.contactsOnly var body: some View { Form { TextField("Computer Name", text: $name) Toggle("Screen Sharing", isOn: $screenSharingEnabled) Toggle("File Sharing", isOn: $fileSharingEnabled) Picker("AirDrop", selection: $airdropVisibility) { ForEach(AirDropVisbility.allCases) { Label($0.label, systemImage: $0.symbolName) .labelStyle(.titleAndIcon) .tag($0) } } } .formStyle(.grouped) } }
-