class Formotion::RowType::EditRow

Public Instance Methods

on_select(tableView, tableViewDelegate) click to toggle source
# File lib/formotion/row_type/edit_row.rb, line 6
def on_select(tableView, tableViewDelegate)
  was_editing = tableView.isEditing
  if row.alt_title
    new_title = !was_editing ? row.alt_title : row.title
    tableView.cellForRowAtIndexPath(row.index_path).textLabel.text = new_title
  end
  tableView.setEditing(!was_editing, animated: true)
end