Skip to content

anthann/GPRChinaAddressIndex

Repository files navigation

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.

About

中国大陆省市区三级行政区划索引

Resources

License

Stars

Watchers

Forks

Packages

No packages published