iOS SDK Version

AKFPhoneNumber

@interfaceAKFPhoneNumber:NSObject<NSCopying,NSSecureCoding>
This class represents a phone number.
  • This is the designated initializer.
    While it is safe to provide any characters for the countryCode and phoneNumber, the values should only contain digits. All other characters will be stripped from this value when it is used.

    Declaration

    Objective-C
    -(nonnullinstancetype)initWithCountryCode:(nonnullNSString*)countryCodephoneNumber:(nonnullNSString*)phoneNumber;
    Swift
    init(countryCode:String,phoneNumber:String)

    Parameters

    countryCode
    the country code for the phone number
    phoneNumber
    the remaining portion of the phone number
  • This additional initializer stores the corresponding country ISO code to the country code for the phone number

    Declaration

    Objective-C
    -(nonnullinstancetype)initWithCountryCode:(nonnullNSString*)countryCodecountryISO:(nonnullNSString*)isophoneNumber:(nonnullNSString*)phoneNumber;
    Swift
    convenienceinit(countryCode:String,countryISOiso:String,phoneNumber:String)
  • Unavailable
    Undocumented

    Declaration

    Objective-C
    -(instancetype)initNS_UNAVAILABLE;
  • Unavailable
    Undocumented

    Declaration

    Objective-C
    +(instancetype)newNS_UNAVAILABLE;
  • The country code for the phone number.

    Declaration

    Objective-C
    @property(readonly,copy,nonatomic)NSString*_NonnullcountryCode;
    Swift
    varcountryCode:String{get}
  • The country ISO code for the phone number. The ISO code for the country code can be nil

    Declaration

    Objective-C
    @property(readonly,copy,nonatomic)NSString*_NonnullcountryISO;
    Swift
    varcountryISO:String{get}
  • The remaining portion of the phone number after the country code.

    Declaration

    Objective-C
    @property(readonly,copy,nonatomic)NSString*_NonnullphoneNumber;
    Swift
    varphoneNumber:String{get}
  • Compares the receiver to another phone number

    Declaration

    Objective-C
    -(BOOL)isEqualToPhoneNumber:(nonnullAKFPhoneNumber*)phoneNumber;
    Swift
    funcisEqual(tophoneNumber:PhoneNumber)->Bool

    Parameters

    phoneNumber
    the phone number to compare to
  • Converts the receiver to an NSString.
    All characters that are not digits will be stripped from the phone number and a + character will precede the country code value.

    Declaration

    Objective-C
    -(nonnullNSString*)stringRepresentation;
    Swift
    funcstringRepresentation()->String