在Swift中数组Array没有removeObject的方法
1、找到下标
let model_index = selectedArray.index(where: { (arr) -> Bool in
((selectedBeaconArray.index(of: vbModel)) != nil)
})
2、删除下标对应的元素
if model_index != nil{
selectedBeaconArray.remove(at: model_index ?? 0)
}
在Swift中数组Array没有removeObject的方法
let model_index = selectedArray.index(where: { (arr) -> Bool in
((selectedBeaconArray.index(of: vbModel)) != nil)
})
if model_index != nil{
selectedBeaconArray.remove(at: model_index ?? 0)
}
相关文章: