Sha256: 45ceb5a2e4518e3fe1dfaf808e218a537196cf19f0b319be8b2a9a6f8499c309

Contents?: true

Size: 452 Bytes

Versions: 7

Compression:

Stored size: 452 Bytes

Contents

motion_require 'button'

module Formotion
  module RowType
    class EditRow < ButtonRow
      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
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
formotion-1.8 lib/formotion/row_type/edit_row.rb
formotion-1.7 lib/formotion/row_type/edit_row.rb
formotion-1.6 lib/formotion/row_type/edit_row.rb
formotion-1.5.1 lib/formotion/row_type/edit_row.rb
formotion-1.5.0 lib/formotion/row_type/edit_row.rb
formotion-1.4.0 lib/formotion/row_type/edit_row.rb
formotion-1.3.1 lib/formotion/row_type/edit_row.rb