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;

    Swift

    init(day: Int, month: Int, year: Int, originalDateStringResult: MBStringResult?)

    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

    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

    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 }
  • Factory method

    Declaration

    Objective-C

    + (instancetype _Nonnull)dateResultWithDay:(NSInteger)day
                                         month:(NSInteger)month
                                          year:(NSInteger)year
                      originalDateStringResult:
                          (MBStringResult *_Nullable)originalDateStringResult;

    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

    Return Value

    initialized value