热门搜索 :
考研考公
您的当前位置:首页正文

iOS-地址选择器

来源:东饰资讯网
//选择地区
-(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];
    }];
}
屏幕快照 2017-09-07 下午4.26.43.png
Top