mySwitch.addTarget(self, action: #selector(TopTableViewController.onClickMySwicth(sender:)), for: UIControlEvents.valueChanged) } internal func onClickMySwicth(sender: UISwitch){ /et cellPoint1 = table.convert(sender.center, from: sender.superview) let indexPath1 = table.indexPathForRow(at: cellPoint1) let cell = table.cellForRow(at: indexPath1!) as! TableViewCell if sender.isOn { suittiarrye.remove(at: (indexPath1?.row)!) suittiarrye.insert(true, at: (indexPath1?.row)!) }else { suittiarrye.remove(at: (indexPath1?.row)!) suittiarrye.insert(false, at: (indexPath1?.row)!) cell.svview.backgroundColor = UIColor.lightGray } ////////ここでセルの更新などが必要でしょうか?? } }
変更しました。
swift3.0 xcode8.3
(deleted)
回答1件
あなたの回答
tips
プレビュー