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;

    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;
  • Undocumented

    Declaration

    Objective-C
    -(instancetype)initNS_UNAVAILABLE;
  • Undocumented

    Declaration

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

    Declaration

    Objective-C
    @property(readonly,copy,nonatomic)NSString*_NonnullcountryCode;
  • 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;
  • The remaining portion of the phone number after the country code.

    Declaration

    Objective-C
    @property(readonly,copy,nonatomic)NSString*_NonnullphoneNumber;
  • Compares the receiver to another phone number

    Declaration

    Objective-C
    -(BOOL)isEqualToPhoneNumber:(nonnullAKFPhoneNumber*)phoneNumber;

    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;