Skip to content

Commit

Permalink
Merge pull request #91 from NikKovIos/master
Browse files Browse the repository at this point in the history
Added getLeadingDigits (mobile) method
  • Loading branch information
marmelroy authored Nov 29, 2016
2 parents a84df4f + 839dead commit e60fc42
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions PhoneNumberKit/PhoneNumberKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ public class PhoneNumberKit: NSObject {
return results
}

/// Get leading digits for compliant region code
///
/// - parameter country: ISO 639 compliant region code.
///
/// - returns: leading digits (e.g. 876 for Jamaica).
public func getLeadingDigits(for country: String) -> String? {
let leadingDigits = metadataManager.filterTerritories(byCountry: country)?.leadingDigits
return leadingDigits
}

/// Determine the region code of a given phone number.
///
/// - parameter phoneNumber: PhoneNumber object
Expand Down

0 comments on commit e60fc42

Please sign in to comment.