如何“在序列上调用'contains()'方法?”
func deleteSelfieObjectFromList(selfieImgObject: SelfieImage) {
if contains(self.dataArray, selfieImgObject) {
removeObject(&self.dataArray, object: selfieImgObject)
self.collectionView?.reloadData()
}
}
答案 0 :(得分:0)
像这样:
let arr = [42]
if arr.contains(42) {
print("found")
}