CardExpiryDate

@objc(DTCardExpiryDate)
@objcMembers
public class CardExpiryDate : NSObject, Codable, NSCopying

Class to be used to represent the card expiry date (month and year).

  • Formats the month to a two digit string.

    Declaration

    Swift

    public var formattedMonth: String { get }
  • Formats the year to a two digit string.

    Declaration

    Swift

    public var formattedYear: String { get }
  • Card expiry month, [1, 12], e.g. 1 for January or 12 for December

    Declaration

    Swift

    public var month: Int { get set }
  • Card expiry year, 2 or 4 digits, e.g. 30 or 2030

    Declaration

    Swift

    public var year: Int { get set }
  • Initializes the card expiry date with the given month and year.

    Declaration

    Swift

    public init(month: Int, year: Int)

    Parameters

    month

    Card expiry month, [1, 12], e.g. 1 for January or 12 for December

    year

    Card expiry year, 2 or 4 digits, e.g. 30 or 2030

  • Refer to the Decodable protocol

    Declaration

    Swift

    public required init(from decoder: Decoder) throws
  • Refer to the Encodable protocol

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Refer to the NSObject protocol

    Declaration

    Swift

    override public var description: String { get }
  • Refer to the NSCopying protocol

    Declaration

    Swift

    public func copy(with zone: NSZone? = nil) -> Any