We can't have an accessory_view AND a switch, so don't try and set them if they both exist. accessory_view takes precedence over a switch accessory.

This commit is contained in:
Mark Rickert
2013-06-06 09:49:35 -04:00
parent 97b9ba5edb
commit 67bc0ab08c

View File

@@ -44,9 +44,7 @@ module ProMotion
if data_cell[:accessory_view]
self.accessoryView = data_cell[:accessory_view]
self.accessoryView.autoresizingMask = UIViewAutoresizingFlexibleWidth
end
if data_cell[:accessory] && data_cell[:accessory] == :switch
elsif data_cell[:accessory] && data_cell[:accessory] == :switch
switch_view = UISwitch.alloc.initWithFrame(CGRectZero)
switch_view.addTarget(self, action: "accessory_toggled_switch:", forControlEvents:UIControlEventValueChanged)
switch_view.on = true if data_cell[:accessory_checked]