From 67bc0ab08c0a62bf786613310e54e45b88e05af0 Mon Sep 17 00:00:00 2001 From: Mark Rickert Date: Thu, 6 Jun 2013 09:49:35 -0400 Subject: [PATCH] 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. --- lib/ProMotion/screens/_tables/table_view_cell_module.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/ProMotion/screens/_tables/table_view_cell_module.rb b/lib/ProMotion/screens/_tables/table_view_cell_module.rb index 1971afc..00b47c1 100644 --- a/lib/ProMotion/screens/_tables/table_view_cell_module.rb +++ b/lib/ProMotion/screens/_tables/table_view_cell_module.rb @@ -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]