A simple country picker for iOS with full language support.
To run the example project, clone the repo, and run pod install
from the Example directory first.
GSCountryPickerController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "GSCountryPickerController"
#import "GSCountryPickerController.h"
@interface MyViewController () <GSCountryPickerControllerDelegate>
// ...
@end
#pragma mark - GSCountryPickerControllerDelegate
- (void)countryPickerController:(GSCountryPickerController *)picker
didSelectCountryCode:(NSString *)countryCode
localizedName:(NSString *)localizedName {
// ...
}
- (void)countryPickerControllerDidCancel:(GSCountryPickerController *)picker {
// ...
}
- (void)selectCountryAction {
GSCountryPickerController *vc = [GSCountryPickerController new];
vc.countryPickerdelegate = self;
[self presentViewController:vc animated:YES completion:nil];
}
gaosen, 0x5e@sina.cn
GSCountryPickerController is available under the MIT license. See the LICENSE file for more info.