Skip to content
中国大陆省市区三级行政区划索引
Objective-C Shell Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example
GPRChinaAddressIndex
.gitignore
.travis.yml
GPRChinaAddressIndex.podspec
LICENSE
README.md
_Pods.xcodeproj

README.md

GPRChinaAddressIndex

CI Status Version License Platform

中国行政区划,方便开发者制作用于选择省、市、区的控件。 常见的场景是方便电商app的用户编辑收货地址。

Example

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

Installation

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

pod "GPRChinaAddressIndex"

Usage

NSArray <GPRAddressModel *>*provinces = [[GPRChinaAddressIndex sharedInstance] getProvince];
NSArray <GPRAddressModel *>*cities = [[GPRChinaAddressIndex sharedInstance] getCityByProvinceID:@"110000"];
//110000是北京市(省级单位)的id,可以用过上一级列表检索到。接口返回北京市(省级)下属的市(因为是直辖市,cities.count == 1)。
NSArray <GPRAddressModel *>*cities = [[GPRChinaAddressIndex sharedInstance] getTownByCityID:@"110100"];
//110100是北京市(市级单位)的id,可以用过上一级列表检索到。接口返回北京市下属各个区。

Author

anthann, 72115165g@gmail.com

License

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

You can’t perform that action at this time.