//选择地区
-(void)ShowAddressView:(UIButton*)sender{
self.NewAddress=[[NewAddressView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
self.NewAddress.delegate=self;
if (self.province!=nil&&self.city!=nil&&self.town!=nil) {
[self.NewAddress setSelectedProvince:self.province andCity:self.city andTown:self.town];
}
[self.view addSubview:self.NewAddress];
}
#pragma mark NewAddressViewDelegate
-(void)dismissAddressViewProvince:(NSString *)province City:(NSString *)city Town:(NSString *)town isCancel:(BOOL)cancel{
[UIView animateWithDuration:0.25 animations:^{
if (!cancel) {
self.province=province;
self.city=city;
self.town=town;
self.addressLabel.text=[NSString stringWithFormat:@"%@ %@ %@",self.province,self.city,self.town];
}
} completion:^(BOOL finished) {
[self.NewAddress removeFromSuperview];
}];
}
demo链接github