Skip to content

Commit

Permalink
Added get leadingDigin (mobile) method
Browse files Browse the repository at this point in the history
  • Loading branch information
Nik Kov committed Nov 29, 2016
1 parent a84df4f commit 839dead
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 839dead

Please sign in to comment.