中国行政区划,方便开发者制作用于选择省、市、区的控件。 常见的场景是方便电商app的用户编辑收货地址。
To run the example project, clone the repo, and run pod install
from the Example directory first.
GPRChinaAddressIndex is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "GPRChinaAddressIndex"
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,可以用过上一级列表检索到。接口返回北京市下属各个区。
anthann, 72115165g@gmail.com
GPRChinaAddressIndex is available under the MIT license. See the LICENSE file for more info.