Latest 1.0.0
Homepage https://github.com/enix223/CNCitySelector
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors

开箱即用,一个零配置,快速集成的中国行政区域选择Controller

CNCitySelector

Example

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

Requirements

iOS 9.0

Installation

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

pod 'CNCitySelector'

Usage

  1. 初始化CNCitySelectController
CNCitySelectController *vc = [CNCitySelectController alloc] initWithFrame:frame];
  1. 设置城市数据database, 本repo自带GB2260的城市数据库,如果你需要使用自己的数据库,可以实现CNCityDatabase的数据接口
// GB2260实现了CNCityDatabase协议
vc.datasource = [GB2260 shardInstance];
// self遵循CNCitySelectDelegate协议
vc.delegate = self;
  1. 选择城市后回调 CNCitySelectDelegate
- (void)didSelectRegion:(CNRegion *)region {
    NSLog(@"Select city: %@", region.name);
}

That’s all

Author

Enix Yu, [email protected]

License

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

Latest podspec

{
    "name": "CNCitySelector",
    "version": "1.0.0",
    "summary": "u4e00u4e2au96f6u914du7f6euff0cu5febu901fu96c6u6210u7684u4e2du56fdu884cu653fu533au57dfu9009u62e9Controller",
    "description": "u4e00u4e2au96f6u914du7f6euff0cu5febu901fu96c6u6210u7684u4e2du56fdu884cu653fu533au57dfu9009u62e9Controller, u5f00u7bb1u5373u7528uff0cu975eu5e38u65b9u4fbfu3002",
    "homepage": "https://github.com/enix223/CNCitySelector",
    "screenshots": "https://github.com/enix223/CNCitySelector/raw/master/Example/Screenshot/screen.jpeg",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Enix Yu": "[email protected]"
    },
    "source": {
        "git": "https://github.com/enix223/CNCitySelector.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://twitter.com/enixyu",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "CNCitySelector/Classes/**/*",
    "resource_bundles": {
        "CNCitySelector": [
            "CNCitySelector/Assets/**/*",
            "CNCitySelector/Classes/*.xib"
        ]
    },
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This