MBDateResult


@interface 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.

  • Undocumented

    Declaration

    Objective-C

    - (instancetype _Nonnull)init NS_UNAVAILABLE;
  • Designated initializer

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithDay:(NSInteger)day
                                   month:(NSInteger)month
                                    year:(NSInteger)year
                      originalDateString:(NSString *_Nullable)originalDateString;

    Swift

    init(day: Int, month: Int, year: Int, originalDateString: String?)

    Parameters

    day

    day of month

    month

    month of year

    year

    gregorian calendar

    originalDateString

    original string which describes that result, e.g 23.4.1988.

    Return Value

    initialized value

  • The original string used to create the date result

    Declaration

    Objective-C

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

    Swift

    var originalDateString: String? { get }
  • NSDate object which represents the same date as this result

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSDate *date;

    Swift

    var date: Date? { get }
  • day

    Day in month.

    Declaration

    Objective-C

    @property (readonly, assign, nonatomic) NSInteger day;

    Swift

    var day: Int { get }
  • Month in year.

    Declaration

    Objective-C

    @property (readonly, assign, nonatomic) NSInteger month;

    Swift

    var month: Int { get }
  • Year of the current date.

    Declaration

    Objective-C

    @property (readonly, assign, nonatomic) NSInteger year;

    Swift

    var year: Int { get }
  • Factory method

    Declaration

    Objective-C

    + (instancetype _Nonnull)dateResultWithDay:(NSInteger)day
                                         month:(NSInteger)month
                                          year:(NSInteger)year
                            originalDateString:
                                (NSString *_Nullable)originalDateString;

    Parameters

    day

    day of month

    month

    month of year

    year

    gregorian calendar

    originalDateString

    original string which describes that result, e.g 23.4.1988.

    Return Value

    initialized value