前提・実現したいこと
下の内容のプログラムだと回答済みが表示されません。表示されるようにしたいです。
また、TableViewCellで最低でも一週間ほど回答済みを保持したいです。
###条件、状況
MasterDetailAppフレームワークを使用しています。
固有名詞を覚えるのが苦手なのでなるべく難しいのをださないでくれるとありがたいです。
なぜ、この状況なのか知りたいです。(例:何回も読み込まれているなど)
###コード
MasterView
swift
1 2func configureCell(_ cell: UITableViewCell, withEvent event: Event) { 3 4 let cc = DetailViewController() 5 if (cc.clearCheckNumber==false){ 6 cell.textLabel!.text = "未回答" 7 }else{ 8 cell.textLabel!.text = "回答済み" 9 } 10 } 11
DetailView(一部省略)
swift
1 2class DetailViewController: UIViewController { 3 var clearCheckNumber: Bool = false 4 //checkNumberは省略箇所に3になっています。 5 @IBAction func clearcheck(_ sender: UIButton) { 6 if checkNumber>=3 { 7 button4.setTitle("CLEAR", for: .normal) 8 button4.setTitleColor(UIColor.black, for: .normal) 9 10 clearCheckNumber=true 11 } 12 } 13 14 15 override func viewDidLoad() { 16 super.viewDidLoad() 17 18 button.setTitle("未回答", for: .normal) 19 button.setTitleColor(UIColor.blue, for: .normal) 20 21 button2.setTitle("未回答", for: .normal) 22 button2.setTitleColor(UIColor.blue, for: .normal) 23 24 button3.setTitle("未回答", for: .normal) 25 button3.setTitleColor(UIColor.blue, for: .normal) 26 27 button4.setTitle("未クリア", for: .normal) 28 button4.setTitleColor(UIColor.blue, for: .normal) 29 // Do any additional setup after loading the view. 30 configureView() 31 } 32 33 34} 35 36
あなたの回答
tips
プレビュー