UserConsentView
public struct UserConsentView
extension UserConsentView: View
extension UserConsentView: _ViewEmptyChecking
UserConsentView
is used to display a series of user consent screens modally during the process of onboarding.
Usage
UserConsentView {
UserConsentForm(userConsentPages: {
UserConsentPage {
Text("Form 0 Page 0")
} bodyText: {
Text("detailText")
} action: {
Button {
} label: {
Text("Learn more about privacy")
}
}
UserConsentPage {
Text("Form 0 Page 1")
} bodyText: {
Text("detailText")
} action: {
Button {
} label: {
Text("Learn more about privacy")
}
}
},
didAllow: { print("UserConsentForm - didAllow") }
)
UserConsentForm(userConsentPages: {
UserConsentPage {
Text("Form 1 Page 0")
} bodyText: {
Text("detailText")
} action: {
Button {
} label: {
Text("Learn more about Data Privacy")
}
}
},
isRequired: false,
didAllow: { print("UserConsentForm - didAllow") })
} didAllow: {
print("UserConsentView - didAllow: index: \($0)")
} didDeny: {
print("UserConsentView - didDeny: index: \($0), isRequired: \($1)")
} didCancel: { _ in
print("UserConsentView - didCancel")
} didFinish: { _ in
presentationMode.wrappedValue.dismiss()
}
-
Undocumented
Declaration
Swift
public init(@IndexedViewBuilder userConsentForms: () -> any IndexedViewContainer = { EmptyView() }, didAllow: ((Int) -> Void)? = nil, didDeny: ((Int, Bool) -> Void)? = nil, didCancel: ((Int) -> Void)? = nil, didFinish: (([Int]) -> Void)? = nil, componentIdentifier: String? = UserConsentView.identifier)
-
Undocumented
Declaration
Swift
static let identifier: String
-
Undocumented
Declaration
Swift
init(userConsentForms: [UserConsentForm] = [], didAllow: ((Int) -> Void)? = nil, didDeny: ((Int, Bool) -> Void)? = nil, didCancel: ((Int) -> Void)? = nil, didFinish: (([Int]) -> Void)? = nil)
-
Undocumented
Declaration
Swift
init(_ configuration: UserConsentViewConfiguration)
-
Declaration
Swift
public var body: some View { get }
-
Undocumented
Declaration
Swift
public var isEmpty: Bool { get }