Move the accessory code into the tableview's remap_data_cell method so we can handle cell identifiers better.

This commit is contained in:
Mark Rickert
2013-06-11 10:26:21 -04:00
parent 8fba16a8d0
commit 0f86eff38d
2 changed files with 10 additions and 10 deletions

View File

@@ -129,6 +129,16 @@ module ProMotion
data_cell[:styles][:label] = data_cell[:styles][:textLabel]
end
# Fix the accessory view if needed
# Legacy Support < 0.7.4
data_cell[:accessory] ||= data_cell[:accessory_view]
data_cell[:accessory] = {
view: data_cell[:accessory],
value: data_cell[:accessory_value],
action: data_cell[:accessory_action],
arguments: data_cell[:accessory_arguments]
} unless data_cell[:accessory].is_a? Hash
data_cell
end

View File

@@ -43,16 +43,6 @@ module ProMotion
end
def set_accessory_view
# Legacy Support < 0.7.4
data_cell[:accessory] ||= data_cell[:accessory_view]
data_cell[:accessory] = {
view: data_cell[:accessory],
value: data_cell[:accessory_value],
action: data_cell[:accessory_action],
arguments: data_cell[:accessory_arguments]
} unless data_cell[:accessory].is_a? Hash
# End Legacy Support
if data_cell[:accessory][:view] == :switch
switch_view = UISwitch.alloc.initWithFrame(CGRectZero)
switch_view.setAccessibilityLabel(data_cell[:accessory][:accessibility_label]) if data_cell[:accessory][:accessibility_label]