SBSDKUIWorkflowStep

@interface SBSDKUIWorkflowStep : NSObject

A class describing one single step of a workflow. There are some pre-defined workflow steps but you also may may subclass and create your own custom steps.

  • The title being displayed in the ‘SBSDKUIWorkflowScannerViewController’ while it processes the receiver.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *title;

    Swift

    var title: String? { get }
  • A message being displayed in the ‘SBSDKUIWorkflowScannerViewController’ while it processes the receiver.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *message;

    Swift

    var message: String? { get }
  • A block to validate the results of the receiver. In this block you validate the processing results of the receiver and return an error if the validation fails. In case you return an error the step is repeated, otherwise (return nil) the workflow is being continued. If set to nil, no validation is performed and the step is threated as being successful.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable)
        SBSDKUIWorkflowStepValidationHandler resultValidationHandler;

    Swift

    var resultValidationHandler: SBSDKUIWorkflowStepValidationHandler? { get }
  • An array of required aspect ratios if this step uses document detection.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable)
        NSArray<SBSDKPageAspectRatio *> *requiredAspectRatios;

    Swift

    var requiredAspectRatios: [SBSDKPageAspectRatio]? { get }
  • An array of accepted machine code types if this step QR- or barcode detection.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable)
        NSArray<AVMetadataObjectType> *acceptedMachineCodeTypes;

    Swift

    var acceptedMachineCodeTypes: [AVMetadataObject.ObjectType]? { get }
  • Set to YES, if the receiver requires a high-resolution still image shot for its processing.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL wantsCapturedPage;

    Swift

    var wantsCapturedPage: Bool { get }
  • Set to YES, if the receiver requires a low-resolution video frame image for its processing.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL wantsVideoFramePage;

    Swift

    var wantsVideoFramePage: Bool { get }
  • Set to YES, if the receiver requires the detection of machine readable codes (QR, barcodes) for its processing.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL wantsMachineReadableCodes;

    Swift

    var wantsMachineReadableCodes: Bool { get }
  • If set to YES, step validation errors will be displayed as the message. Defaults to NO.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL runsContinousValidation;

    Swift

    var runsContinousValidation: Bool { get }
  • Not available.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Not available.

    Declaration

    Objective-C

    + (nonnull instancetype)new;
  • Designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithTitle:(nullable NSString *)title
                                  message:(nullable NSString *)message
                     requiredAspectRatios:
                         (nullable NSArray<SBSDKPageAspectRatio *> *)
                             requiredAspectRatios
                        wantsCapturedPage:(BOOL)wantsCapturedPage
                      wantsVideoFramePage:(BOOL)wantsVideoFramePage
         acceptedMachineReadableCodeTypes:
             (nullable NSArray<AVMetadataObjectType> *)acceptedMachineReadableCodes
                         resultValidation:
                             (nullable SBSDKUIWorkflowStepValidationHandler)
                                 resultValidationHandler;

    Swift

    init(title: String?, message: String?, requiredAspectRatios: [SBSDKPageAspectRatio]?, wantsCapturedPage: Bool, wantsVideoFramePage: Bool, acceptedMachineReadableCodeTypes acceptedMachineReadableCodes: [AVMetadataObject.ObjectType]?, resultValidation resultValidationHandler: SBSDKUIWorkflowStepValidationHandler? = nil)

    Parameters

    title

    The title being displayed in the ‘SBSDKUIWorkflowScannerViewController’ while it processes the receiver.

    message

    A message being displayed in the ‘SBSDKUIWorkflowScannerViewController’ while it processes the receiver.

    requiredAspectRatios

    An array of required aspect ratios if this step uses document detection.

    wantsCapturedPage

    Set to YES, if the receiver requires a high-resolution still image shot for its processing.

    wantsVideoFramePage

    Set to YES, if the receiver requires a low-resolution video frame image for its processing.

    acceptedMachineReadableCodes

    An array of accepted machine code types if this step QR- or barcode detection.

    resultValidationHandler

    A block to validate the results of the receiver.

  • Subclasses may override this function to do additonal configuration of the ‘SBSDKScannerViewController’ when this step will be executed. Caution: Changes made here are not automatically restored. You are responsible to revert changes made here for other steps.

    Declaration

    Objective-C

    - (void)configureScannerViewController:
        (nonnull SBSDKScannerViewController *)scanner;

    Swift

    func configureScannerViewController(_ scanner: SBSDKScannerViewController)
  • Subclasses may override this function to post-process the result, e.g. change filter of captured image, run additional detectors etc.

    Declaration

    Objective-C

    - (void)processResult:(nonnull SBSDKUIWorkflowStepResult *)result;

    Swift

    func processResult(_ result: SBSDKUIWorkflowStepResult)