SBSDKGenericTextLineRecognizerViewController

@interface SBSDKGenericTextLineRecognizerViewController
    : SBSDKBaseCameraViewController

A highly customizable camera-based viewcontroller to recognize and validate a small rectangular text area in realtime. A view finder like rectangle shows the area where text is recognized. The camera can be zoomed in and out using an action or a double-tap to make aiming at the desired area easier. Once some text is recognized within the view finder area, the result is delivered to the receivers delegate. A customizable validation routine checks validates the result and sets a flag in the result.

  • The receivers configuration object.

    Declaration

    Objective-C

    @property (nonatomic, strong) SBSDKGenericTextLineRecognizerConfiguration *_Nonnull configuration;

    Swift

    var configuration: SBSDKGenericTextLineRecognizerConfiguration { get set }
  • The receivers delegate object. It is captured as a weak property.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<SBSDKGenericTextLineRecognizerViewControllerDelegate> delegate;

    Swift

    weak var delegate: SBSDKGenericTextLineRecognizerViewControllerDelegate? { get set }
  • Defines a minimum inset for finder. Default is 24 for all sides.

    Declaration

    Objective-C

    @property (nonatomic) UIEdgeInsets finderMinimumInset;

    Swift

    var finderMinimumInset: UIEdgeInsets { get set }
  • Background color of the view finder. Default is white with 0.66 alpha. Must not be nil.

    Declaration

    Objective-C

    @property (nonatomic, strong, nonnull) UIColor *viewFinderBackgroundColor;

    Swift

    var viewFinderBackgroundColor: UIColor { get set }
  • If word boxes should be shown. Default is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldShowWordBoxes;

    Swift

    var shouldShowWordBoxes: Bool { get set }
  • The color of word boxes filling. It is better to use colors with alpha < 0.5.

    Declaration

    Objective-C

    @property (nonatomic, strong, nonnull) UIColor *wordBoxesFillColor;

    Swift

    var wordBoxesFillColor: UIColor { get set }
  • The color of word boxes border lines.

    Declaration

    Objective-C

    @property (nonatomic, strong, nonnull) UIColor *wordBoxesLineColor;

    Swift

    var wordBoxesLineColor: UIColor { get set }
  • Line color of the view finder.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *viewFinderLineColor;

    Swift

    var viewFinderLineColor: UIColor? { get set }
  • Line width of the view finder. Default is 2.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat viewFinderLineWidth;

    Swift

    var viewFinderLineWidth: CGFloat { get set }
  • The current rectangle of the view finder.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGRect currentViewFinderRect;

    Swift

    var currentViewFinderRect: CGRect { get }
  • When this property is set to YES, the default, the zoom can be activated by double tapping somewhere on the receivers view.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isDoubleTapToZoomEnabled) BOOL doubleTapToZoomEnabled;

    Swift

    var isDoubleTapToZoomEnabled: Bool { get set }
  • Defines, if a zooming in\out should be animated. Default is YES;

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldAnimateZooming;

    Swift

    var shouldAnimateZooming: Bool { get set }
  • An IB action to toggle the zoom. Connect to a UIButton instance if needed.

    Declaration

    Objective-C

    - (void)toggleZoom:(nullable id)sender;

    Swift

    @IBAction func toggleZoom(_ sender: Any?)

    Parameters

    sender

    The object that sent the event. Can be nil.

  • An IB action to engage the zoom. Connect to a UIButton instance if needed.

    Declaration

    Objective-C

    - (void)zoomIn:(nullable id)sender;

    Swift

    @IBAction func zoomIn(_ sender: Any?)

    Parameters

    sender

    The object that sent the event. Can be nil.

  • An IB action to disengage the zoom. Connect to a UIButton instance if needed.

    Declaration

    Objective-C

    - (void)zoomOut:(nullable id)sender;

    Swift

    @IBAction func zoomOut(_ sender: Any?)

    Parameters

    sender

    The object that sent the event. Can be nil.

  • Designated initializer. Creates a new instance of SBSDKGenericTextLineRecognizerViewController and embeds it into an existing viewcontroller/view hierarchy if needed.

    Declaration

    Objective-C

    - (nullable instancetype)
        initWithParentViewController:
            (nullable UIViewController *)parentViewController
                          parentView:(nullable UIView *)containerView
                       configuration:
                           (nullable SBSDKGenericTextLineRecognizerConfiguration *)
                               configuration
                            delegate:
                                (nonnull id<
                                    SBSDKGenericTextLineRecognizerViewControllerDelegate>)
                                    delegate;

    Swift

    init?(parentViewController: UIViewController?, parentView containerView: UIView?, configuration: SBSDKGenericTextLineRecognizerConfiguration?, delegate: SBSDKGenericTextLineRecognizerViewControllerDelegate)

    Parameters

    parentViewController

    The view controller the newly created instance is embedded into.

    parentView

    The view the newly created instance is embedded into. If nil the parentViewControllers view is used.

    configuration

    The configuration object to configure the receiver. If nil, the default configuration is used.

    delegate

    The delegate of the receiver.