Sha256: 5e6d587a4abc8f36eb1420c50f6cb6ba7f09b88cad25e32d94c9931b7e91400f

Contents?: true

Size: 780 Bytes

Versions: 11

Compression:

Stored size: 780 Bytes

Contents

#################
#
# Formotion::RowCellBuilder
# RowCellBuilder handles taking Formotion::Rows
# and configuring UITableViewCells based on their properties.
#
#################
module Formotion
  class RowCellBuilder

    # PARAMS row.is_a? Formotion::Row
    # RETURNS [cell configured to that row, a UITextField for that row if applicable or nil]
    def self.make_cell(row)
      cell, text_field = nil

      cell = UITableViewCell.alloc.initWithStyle(row.object.cell_style, reuseIdentifier:row.reuse_identifier)

      cell.accessoryType = cell.editingAccessoryType = UITableViewCellAccessoryNone
      cell.textLabel.text = row.title
      cell.detailTextLabel.text = row.subtitle

      edit_field = row.object.build_cell(cell)

      [cell, edit_field]
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
formotion-1.4.0 lib/formotion/row/row_cell_builder.rb
formotion-1.3.1 lib/formotion/row/row_cell_builder.rb
formotion-1.3 lib/formotion/row/row_cell_builder.rb
formotion-1.2 lib/formotion/row/row_cell_builder.rb
formotion-1.1.5 lib/formotion/row/row_cell_builder.rb
formotion-1.1.4 lib/formotion/row/row_cell_builder.rb
formotion-1.1.3 lib/formotion/row/row_cell_builder.rb
formotion-1.1.2 lib/formotion/row/row_cell_builder.rb
formotion-1.1.1 lib/formotion/row/row_cell_builder.rb
formotion-1.1 lib/formotion/row/row_cell_builder.rb
formotion-1.0 lib/formotion/row/row_cell_builder.rb