Latest 1.0.0
Homepage https://github.com/0x5e/GSCountryPickerController
License MIT
Platforms ios 7.0, requires ARC
Authors

CI Status
Version
License
Platform

A simple country picker for iOS with full language support.

Screenshoots

screenshots_1
screenshots_2
screenshots_3

Features

  • Full language support
  • No additional resource bundles (use system language files actually)
  • Looks like system country picker (Setting -> Preference -> Language & Locale -> Region)
  • Easy to use

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

  • First, import header and add protocol to your ViewController
#import "GSCountryPickerController.h"

@interface MyViewController () <GSCountryPickerControllerDelegate>
    // ...
@end
  • Then, implement the protocol
#pragma mark - GSCountryPickerControllerDelegate

- (void)countryPickerController:(GSCountryPickerController *)picker
           didSelectCountryCode:(NSString *)countryCode
                  localizedName:(NSString *)localizedName {
    // ...
}

- (void)countryPickerControllerDidCancel:(GSCountryPickerController *)picker {
    // ... 
}
  • Instantiate the controller when you want to
- (void)selectCountryAction {
    GSCountryPickerController *vc = [GSCountryPickerController new];
    vc.countryPickerdelegate = self;
    [self presentViewController:vc animated:YES completion:nil];
}

Todo

  • Support runtime language switch (without App restart)
  • Search result

Author

gaosen, [email protected]

License

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

Latest podspec

{
    "name": "GSCountryPickerController",
    "version": "1.0.0",
    "summary": "A simple country picker for iOS with full language support.",
    "homepage": "https://github.com/0x5e/GSCountryPickerController",
    "screenshots": [
        "https://github.com/0x5e/GSCountryPickerController/raw/master/Resource/screenshots_1.png",
        "https://github.com/0x5e/GSCountryPickerController/raw/master/Resource/screenshots_2.png",
        "https://github.com/0x5e/GSCountryPickerController/raw/master/Resource/screenshots_3.png"
    ],
    "license": "MIT",
    "authors": {
        "gaosen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/0x5e/GSCountryPickerController.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "GSCountryPickerController": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This