MBScanElement
@interface MBScanElement : NSObject
The easiest way to UI for Ocr scanning is by specifying the MBScanElements.
Each MBScanElement knows
- it’s name and Parser factory - which are needed for actual parsing
- localized Title and Tooltip - which are needed in the UI
- scanning region - percentage of screen used in scanning the element
- information whether the element was scanned or edited
- actual value of the element, used in business logic after the scannig
-
Designated initializer, defines the unique identifier for this canned element, and Parser factory for it.
Declaration
Objective-C
- (nonnull instancetype)initWithIdentifier:(nonnull NSString *)identifier parser:(nonnull MBParser *)parser;
Swift
init(identifier: String, parser: MBParser)
Parameters
identifier
unique ID for this scan element
parser
parser which knows how to scan this element
Return Value
initialized instance
-
Undocumented
Declaration
Objective-C
MB_INIT_UNAVAILABLE
-
Unique name of the element
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSString *_Nonnull identifier;
Swift
var identifier: String { get }
-
Localized title (used in the Pivot control)
Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSString *_Nonnull localizedTitle;
Swift
var localizedTitle: String { get set }
-
Localized tooltip (used in the tooltip label above the viewfinder)
Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSString *_Nonnull localizedTooltip;
Swift
var localizedTooltip: String { get set }
-
Keyboard type used when editing
Declaration
Objective-C
@property (assign, readwrite, nonatomic) UIKeyboardType keyboardType;
Swift
var keyboardType: UIKeyboardType { get set }
-
Localized initial UITextField text (used in field segment scanning text fields)
Declaration
Objective-C
@property (assign, readwrite, nonatomic) NSString *_Nonnull localizedTextfieldText;
Swift
var localizedTextfieldText: String { get set }
-
YES if the value was scanned, NO otherwise. Note: Both scanned and edited cannot be set to YES.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL scanned;
Swift
var scanned: Bool { get set }
-
YES if the value was manually edited, NO otherwise. Note: Both scanned and edited cannot be set to YES.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL edited;
Swift
var edited: Bool { get set }
-
Actual value for this element
Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSString *_Nonnull value;
Swift
var value: String { get set }
-
Width of scanning region used in UI. Values are between 0.0 and 1.0 where 1.0 is whole screen width and 0.5 is half width.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) float scanningRegionWidth;
Swift
var scanningRegionWidth: Float { get set }
-
Height of scanning region used in UI. Values are between 0.0 and 1.0 where 1.0 is whole screen height and 0.5 is half height.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) float scanningRegionHeight;
Swift
var scanningRegionHeight: Float { get set }