0

Presently I have the following setup where the controller ReminderViewController has a container view which refers to a UITableViewController with the three static cells:enter image description here

Beyond this answer, I have not found any other resources on what to do so that when a user toggles one of the UISwitch within the cells, my SetReminderController would be notified and act accordingly. How would I be able to accomplish this? Thanks!

Community
  • 1
  • 1
daspianist
  • 5,336
  • 8
  • 50
  • 94

2 Answers2

1

From the action methods for your switches, you can access the ReminderViewController with self.parentViewController, and then call any method or set any property in that controller that you want to.

rdelmar
  • 103,982
  • 12
  • 207
  • 218
0

You need to set you UISwitch delegate in your code. If you write your delegate methods, you can catch this behavior and whack switch is changed. Below link would help you. And if you still want to reach the cell, then you can ask for parent ui.

How to catch event of switch changed in custom tableViewCell?

Community
  • 1
  • 1
Güngör Basa
  • 628
  • 2
  • 9
  • 27