OnboardingScanView
public struct OnboardingScanView
extension OnboardingScanView: View
extension OnboardingScanView: _ViewEmptyChecking
OnboardingScanView
is used to display a scanner view to scan a QR code for app activation.
It is also displaying the image thumbnails from camera roll and a button to start photo picker
that user may choose the QR code image directly.
Typically it is used in ActivationScreen and WelcomeScreen
Usage
@State var isScanPresented = false
ActivationScreen(title: "Activation",
descriptionText: "If you received a welcome email, follow the activation link in the email.Otherwise, enter your email address or scan the QR code to start onboarding.",
footnote: "Or",
action: FioriButton(title: "Use your email", action: { _ in
print("ActivationScreen Primary button clicked, email: \(self.inputText)")
}),
secondaryAction: FioriButton(title: "Scan", action: { _ in
self.isScanPresented.toggle()
}),
illustratedMessage: IllustratedMessage(detailImage: {
Image("IllustrationImage").resizable(resizingMode: .stretch)
}, title: {
Text("Activation")
}, description: {
Text("If you received a welcome email, follow the activation link in the email.Otherwise, enter your email address or scan the QR code to start onboarding.")
.padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 0))
}, detailImageSize: .large),
inputText: self.$inputText,
showsIllustratedMessage: self.showsIllustratedMessage)
.sheet(isPresented: $isScanPresented) {
OnboardingScanView(shouldValidateScanResult: { scanResult in
return scanResult == "success"
}, didCancel: {
self.isScanPresented.toggle()
}, usesCameraOnly: false,
didTapContinue: {
self.isScanPresented.toggle()
})
}
-
init(scanViewContext:
shouldValidateScanResult: didCancel: usesCameraOnly: scanConfirmationView: didTapContinue: componentIdentifier: ) Undocumented
Declaration
Swift
public init(scanViewContext: OnboardingScanViewContext = OnboardingScanViewContext(), shouldValidateScanResult: ((String) -> Bool)? = nil, didCancel: (() -> Void)? = nil, usesCameraOnly: Bool = false, @ViewBuilder scanConfirmationView: () -> any View = { EmptyView() }, didTapContinue: (() -> Void)? = nil, componentIdentifier: String? = OnboardingScanView.identifier)
-
Undocumented
Declaration
Swift
static let identifier: String
-
init(scanViewContext:
shouldValidateScanResult: didCancel: usesCameraOnly: scanConfirmationView: didTapContinue: ) Undocumented
Declaration
Swift
init(scanViewContext: OnboardingScanViewContext = OnboardingScanViewContext(), shouldValidateScanResult: ((String) -> Bool)? = nil, didCancel: (() -> Void)? = nil, usesCameraOnly: Bool = false, scanConfirmationView: OnboardingScanConfirmView? = nil, didTapContinue: (() -> Void)? = nil)
-
Undocumented
Declaration
Swift
init(_ configuration: OnboardingScanViewConfiguration)
-
Declaration
Swift
@MainActor public var body: some View { get }
-
Undocumented
Declaration
Swift
public var isEmpty: Bool { get }