修改数组中的某个model的值

2019-01-26  本文已影响4人  落夏简叶

应该直接对数组的值进行操作。参考下面:

func handlePicModel() {
        guard let _ = truckPostModel.pics else { return }
        for i in 0..<truckPostModel.pics!.count {
            truckPostModel.pics![i].smallUrl = truckPostModel.pics![i].url?.getSmallImageString()
            truckPostModel.pics![i].bigUrl = truckPostModel.pics![i].url?.getBigImageString()
        }
    }
上一篇下一篇

猜你喜欢

热点阅读