最近做项目项目,看到了个有趣的现象,先是到了选择城市页面YFCityIndexViewController,然后点击某一个城市会到城市下面的区域的页面,后来发现
if (areaArray.count > 0) {
YFCityIndexViewController *vc = [[YFCityIndexViewController alloc] init];
vc.title = @"选择地区";
vc.type = IndexType_Area;
vc.cityId = cityId;
vc.cityIndexBlock = self.cityIndexBlock;
vc.modelArray = areaArray;
[self.navigationController pushViewController:vc animated:YES];
}else{
[self showHud:@"地区列表为空"];
}
当前控制器还能自己跳转到自己,而且很完美的复用页面
本文介绍了一个有趣的iOS项目现象:通过条件判断实现城市选择页面的自我调用与复用,展示了如何根据城市ID加载对应区域列表,并优雅地处理空列表情况。
443

被折叠的 条评论
为什么被折叠?



