地区选择视图 - 自定义 PickerVier 练习
使用步骤:
- 导入头文件
#import "HMAddressPickerView.h"
- 设置输入视图和完成回调
__weak typeof(self) weakSelf = self;
self.textField.inputView = [[HMAddressPickerView alloc] initWithCompletion:^(HMProvince *province, HMCity *city, HMDistrict *district) {
weakSelf.textField.text = [NSString stringWithFormat:@"%@ - %@ - %@", province.name, city.name, district.name];
}];
代码比较简单,没有放在 cocoapod
上了,有兴趣的朋友直接那去用就好,:D