SINRegionList Protocol Reference

Conforms to NSObject
Declared in SINRegionInfo.h

Overview

SINRegionList provides a full list of countries / regions that can be iterated, and it also provides lookup based on ISO 3366-1 country.

  entries required method

Returns all region info entries (not sorted in any particular order).

@property (nonatomic, strong, readonly) NSArray<id<SINRegionInfo> > *entries

Discussion

Example usage:

// Get a list of regions sorted by display name (e.g. for // displaying in a UITableView for example).

NSLocale locale = [NSLocale currentLocale]; id regions = [SINPhoneNumberUtil() regionListWithLocale:locale]; NSSortDescriptor sortDescriptor; sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@“countryDisplayName” ascending:YES]; NSArray<idSINRegionInfo> sorted; sorted = [regions.entries sortedArrayUsingDescriptors:@[ sortDescriptor ]];

Declared In

SINRegionInfo.h

– displayNameForRegion: required method

Get a display name for a particular ISO-3166-1 country code.

- (NSString *)displayNameForRegion:(NSString *)isoCountryCode

Return Value

A display name given an ISO-3166-1 countryCode. Returns empty string if no display name can be found.

Declared In

SINRegionInfo.h

– countryCallingCodeForRegion: required method

Get ITU-T country calling code by ISO-3166-1 country code. E.g. returns 1 for “US”.

- (nullable NSNumber *)countryCallingCodeForRegion:(NSString *)isoCountryCode

Return Value

An ITU-T country calling code. Returns nil if no calling code can be determined.

Declared In

SINRegionInfo.h