mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-05-30 17:33:53 +08:00
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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user