-1
是否可以一次只選擇兩個UITableview單元格?目前我只能設置單個選擇或UITableView的多個選擇。如何在swift中一次只選擇兩個UITableview單元格
任何人都可以發佈這個想法或代碼在Swift3中嗎?
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("MyIdentifier") as! UITableViewCell
let currentItem = data[indexPath.row]
if currentItem.selected {
cell.imageView!.image = UIImage(named:"check")!
cell.textLabel!.font = UIFont(name:"OpenSans-Bold", size:15)
} else {
cell.imageView!.image = nil
cell.textLabel!.font = UIFont(name:"OpenSans-Regular", size:15)
}
return cell
}
如何做到這一點? –
我會更新答案更詳細 –
謝謝...這將是非常有益的 –