0x5e / GSCountryPickerController

A simple country picker for iOS with system language localized, and don't need any additional resource bundles.
MIT License
3 stars 2 forks source link
cocoapods ios

GSCountryPickerController

CI Status Version License Platform

A simple country picker for iOS with full language support.

Screenshoots

screenshots_1 screenshots_2 screenshots_3

Features

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

GSCountryPickerController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "GSCountryPickerController"

How to use

#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];
}

Todo

Author

gaosen, 0x5e@sina.cn

License

GSCountryPickerController is available under the MIT license. See the LICENSE file for more info.