MBDateResult
Objective-C
@interface MBDateResult : NSObject <MBNativeResult>
Swift
class MBDateResult : NSObject, MBNativeResult
This class represents a Date result scanned from the image. It supports obtaining raw NSDates, or raw strings Which are in the same format to the text printed on the image.
While converting to NSDate, internally prior knowledge about scanned document is used to use the right format.
-
Designated initializer
Declaration
Objective-C
- (instancetype _Nonnull)initWithDay:(NSInteger)day month:(NSInteger)month year:(NSInteger)year originalDateStringResult: (MBStringResult *_Nullable)originalDateStringResult isFilledByDomainKnowledge:(BOOL)isFilledByDomainKnowledge;
Swift
init(day: Int, month: Int, year: Int, originalDateStringResult: MBStringResult?, isFilledByDomainKnowledge: Bool)
Parameters
day
day of month
month
month of year
year
gregorian calendar
originalDateStringResult
contains original string which describes that result, e.g “23.4.1988.” for every supported alphabet
isFilledByDomainKnowledge
indicates that date is filled by our internal domain knowledge
Return Value
initialized value
-
The original string used to create the date result
Declaration
Objective-C
@property (nonatomic, readonly, nullable) MBStringResult *originalDateStringResult;
Swift
var originalDateStringResult: MBStringResult? { get }
-
NSDate object which represents the same date as this result
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSDate *date;
Swift
var date: Date? { get }
-
Day in month.
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger day;
Swift
var day: Int { get }
-
Month in year.
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger month;
Swift
var month: Int { get }
-
Year of the current date.
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger year;
Swift
var year: Int { get }
-
Indicates that date does not appear on the document but is filled by our internal domain knowledge.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL isFilledByDomainKnowledge;
Swift
var isFilledByDomainKnowledge: Bool { get }
Return Value
true if the date is filled by our internal domain knowledge
-
Factory method
Declaration
Objective-C
+ (instancetype _Nonnull)dateResultWithDay:(NSInteger)day month:(NSInteger)month year:(NSInteger)year originalDateStringResult: (MBStringResult *_Nullable)originalDateStringResult isFilledByDomainKnowledge:(BOOL)isFilledByDomainKnowledge;
Parameters
day
day of month
month
month of year
year
gregorian calendar
originalDateStringResult
contains original string which describes that result, e.g “23.4.1988.” for every supported alphabet
isFilledByDomainKnowledge
indicates that date is filled by our internal domain knowledge
Return Value
initialized value