選擇省市區
阿新 • • 發佈:2018-05-04
pick CI log else dem 分享 count tar select
//可以選擇到省市區、省市、省
-(void)btnClick:(UIButton *)button{ __weak typeof(self) weakSelf = self; PlacePickMainController *vc = [[PlacePickMainController alloc] init]; if (button.tag == 0) { vc.pickType = PlacePickTypeToCounty;//選擇省-市-區 }else if (button.tag == 1){ vc.pickType = PlacePickTypeToCity;//選擇省-市 }else{ vc.pickType = PlacePickTypeToProvince;//選擇省 } [weakSelf.navigationController pushViewController:vc animated:YES]; __weak PlacePickMainController *weakVC = vc; weakVC.FinishDoneBlock = ^(NSString *selectAllStr, NSString *provinceID, NSString *cityID, NSString *countryID, NSString *holeInfoStr) { NSLog(@"%@---%@---%@----%@",provinceID,cityID,countryID,holeInfoStr); [button setTitle:holeInfoStr forState:UIControlStateNormal]; }; }
DEMO地址 https://github.com/justqi/DQPlacePick
選擇省市區