A binding that indicates whether the app presents the picker view.
Instance Method
インスタンスメソッド
family
familyActivityPicker(isPresented:selection:)
Presents an activity picker view as a sheet.
Availability 有効性
- iOS 15.0+
- iPadOS 15.0+
- Mac Catalyst 15.0+
Technology
- Swift
UI
Declaration 宣言
func familyActivityPicker(isPresented: Binding
<Bool
>, selection: Binding
<FamilyActivitySelection
>) -> some View
Parameters パラメータ
isPresented
selection
A binding that manages the user-selected categories, apps, and web domains.
Discussion 議論
Use this view modifier to present a Family
.
struct ExampleView: View {
var selection = FamilyActivitySelection()
var isPresented = false
var body: some View {
Button("Present FamilyActivityPicker") { isPresented = true }
.familyActivityPicker(isPresented: $isPresented,
selection: $selection)
.onChange(of: selection) { newSelection in
let applications = selection.applications
let categories = selection.categories
let webDomains = selection.webDomains
}
}
}