Closed zhangfurun closed 4 years ago
changeBlock
;isAutoSelect
做不同的业务处理;
覆盖多种应用场景,可以结合自己的需求进行使用。
// 地区
BRAddressPickerView *addressPickerView = [[BRAddressPickerView alloc]init];
addressPickerView.pickerMode = BRAddressPickerModeArea;
addressPickerView.title = @"请选择地区";
addressPickerView.selectIndexs = self.addressSelectIndexs;
//addressPickerView.isAutoSelect = YES;
addressPickerView.resultBlock = ^(BRProvinceModel *province, BRCityModel *city, BRAreaModel *area) {
self.addressSelectIndexs = @[@(province.index), @(city.index), @(area.index)];
textField.text = [NSString stringWithFormat:@"%@ %@ %@", province.name, city.name, area.name];
};
__weak BRAddressPickerView *weakAddressPickerView = addressPickerView; addressPickerView.cancelBlock = ^{ NSLog(@"选择取消的回调"); if (weakAddressPickerView.isAutoSelect) { NSLog(@"选择后自动回调"); } else { NSLog(@"选择后手动回调"); } };
[addressPickerView show];
建议: