MBCDate

Objective-C


@interface MBCDate : NSObject <MBCNativeResult>

Swift

class MBCDate : NSObject, MBCNativeResult

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
                      originalDateString:(NSString *_Nullable)originalDateString
               isFilledByDomainKnowledge:(BOOL)isFilledByDomainKnowledge;

    Swift

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

    Parameters

    day

    day of month

    month

    month of year

    year

    gregorian calendar

    originalDateString

    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) NSString *originalDateString;

    Swift

    var originalDateString: String? { 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 }
  • 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)dateWithDay:(NSInteger)day
                                   month:(NSInteger)month
                                    year:(NSInteger)year
                      originalDateString:(NSString *_Nullable)originalDateString
               isFilledByDomainKnowledge:(BOOL)isFilledByDomainKnowledge;

    Parameters

    day

    day of month

    month

    month of year

    year

    gregorian calendar

    originalDateString

    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