CountryPicker
CountryPicker copied to clipboard
How can i show US in top of the list
i want to show US and India for 1st and 2nd position in the picker list.
Can you help me out ?
Thanks, Chinna
Check the note about subclassing at the bottom of the README file. It explains which methods to override to achieve this.
Hi, can you provide the code for US and Indian in 1st and 2nd order ?
Thanks , Chinna
Had the same question. here is the code:
+ (NSArray *)countryNames
{
static NSMutableArray *_countryNames = nil;
if (!_countryNames)
{
_countryNames = [[[self countryNamesByCode].allValues sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] mutableCopy];
[_countryNames insertObject:@"United States" atIndex:0];
[_countryNames insertObject:@"India" atIndex:0];
}
return _countryNames;
}