Class: ProMotion::TableScreen

Inherits:
TableViewController
  • Object
show all
Defined in:
lib/pm_swipe_cells/pm_table_screen.rb

Instance Method Summary collapse

Instance Method Details

#on_cell_created(cell, data) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/pm_swipe_cells/pm_table_screen.rb', line 5

def on_cell_created(cell, data)
  super

  cell.setDelegate((data[:delegate].nil? ? self : data[:delegate])) if cell.respond_to?(:"setDelegate:")
  if data[:properties]
    cell.config(right_buttons: data[:properties][:right_buttons], left_buttons: data[:properties][:left_buttons]) if cell.respond_to?(:config)
  end
end

#swipeableTableViewCell(cell, didTriggerLeftUtilityButtonWithIndex: index) ⇒ Object



20
21
22
# File 'lib/pm_swipe_cells/pm_table_screen.rb', line 20

def swipeableTableViewCell(cell, didTriggerRightUtilityButtonWithIndex: index)
  trigger_action(cell.right_buttons[index][:action], cell.right_buttons[index][:arguments], cell.index_path) if (cell.right_buttons and cell.right_buttons[index])
end

#tableView(tableView, cellForRowAtIndexPath: indexPath) ⇒ Object



14
15
16
17
18
# File 'lib/pm_swipe_cells/pm_table_screen.rb', line 14

def tableView(tableView, cellForRowAtIndexPath: indexPath)
  cell = super
  cell.index_path = indexPath if cell.respond_to?(:index_path)
  cell
end