iOS开发之地域选择

    代码地址:

https://github.com/boundlessocean/AreaPickViewDome.git

    

    效果:

 

 

第一步: 将BLAreaPickerView

导入工程

 

 
 

第二步: 设置代理

@interface LHQNewAddCustomersCtrl ()<BLPickerViewDelegate>

 

 

第三步: 在需要显示控件的地方初始化

 

- (void)dataBtnClicked1{

    _pickView = [[BLAreaPickerView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 150)];

    _pickView.pickViewDelegate = self;

    [_pickView bl_show];

}

 

 

第四步: 实现代理方法,给按钮赋值

 

 

#pragma mark - - BLPickerViewDelegate

- (void)bl_selectedAreaResultWithProvince:(NSString *)provinceTitle city:(NSString *)cityTitle area:(NSString *)areaTitle{

//    NSLog(@"%@,%@,%@",provinceTitle,cityTitle,areaTitle);

    NSString *areaStr = [NSString stringWithFormat:@"%@%@%@",provinceTitle,cityTitle,areaTitle];

    _areaStr = areaStr;

    [_dataBtn1 setTitle:_areaStr forState:UIControlStateNormal];

}

 

 

 

 

 

              李洪强

 

        2017年6月14日于北京

 

 

 

 
posted @ 2017-06-14 16:35  李洪强  阅读(413)  评论(0编辑  收藏  举报