Latest 0.0.3
License MIT
Platforms ios 7.0

GitHub license
stars CocoaPods

A support of Interface Builder and code to create custom very high level Chinese City Selector.


Written code.

// 使用代码的方式添加也行
CGRect pickerViewFrame = CGRectMake(0, self.view.bounds.size.height-180, self.view.bounds.size.width, 180);

// 1、创建
CNCityPickerView *pickerView = [CNCityPickerView createPickerViewWithFrame:pickerViewFrame valueChangedCallback:^(NSString *province, NSString *city, NSString *area) {

   _displayLabel.text = [NSString stringWithFormat:@"%@  %@  %@", province, city, area];


// 2、可选设置的属性
pickerView.textAttributes = @{NSForegroundColorAttributeName : [UIColor redColor],
                             NSFontAttributeName : [UIFont boldSystemFontOfSize:18.0f]
pickerView.rowHeight = 30.0f;

// 3、添加到指定视图
[self.view addSubview:pickerView];

Use Interface Builder.

// 直接拖IB也行哦
__weak UILabel *displayLabel = _displayLabel;
[_cityPickerView setValueChangedCallback:^(NSString *province, NSString *city, NSString *area) {
    displayLabel.text = [NSString stringWithFormat:@"%@  %@  %@", province, city, area];


pod 'CNCityPickerView'

All you need to do is drop CNCityPickerView files into your project, and add #include "CNCityPickerView.h" to the top of classes that will use it.


CNCityPickerView is available under the MIT license.

Latest podspec

    "name": "CNCityPickerView",
    "version": "0.0.3",
    "summary": "A support of IB and code to create Chinese City Selector.",
    "description": "1u3001Support Interface Builder.n2u3001Support custom very high level.n",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Bi Weiming": "[email protected]"
    "platforms": {
        "ios": "7.0"
    "source": {
        "git": "",
        "tag": "0.0.3"
    "source_files": [

Pin It on Pinterest

Share This