数组:
*懒加载
lazy var homeListArray: [HomeIndexDataModel] = {
let tempArr = [HomeIndexDataModel]()
return tempArr
}()
*数组加载元素
homeListArray.append(item)
*数组遍历
for (index, item) in homeListArray.enumerated() {
if item.marketId == model?.MARKET?.marketId {
homeListArray.remove(at: index)
homeListArray.insert((model?.MARKET)!, at: index)
if homeListArray.count > 0 {homeBottomListTableView.reloadData()}
}
}
网友评论