mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-05-29 16:06:31 +08:00
Move the accessory code into the tableview's remap_data_cell method so we can handle cell identifiers better.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user