class MotionForm

Attributes

button_text_color[W]
section_header_color[W]
section_header_font[W]
section_header_text_color[W]

Public Class Methods

button_text_color() click to toggle source
# File lib/project/motion_form.rb, line 55
def button_text_color
  @button_text_color || '#232323'.to_color
end
config() { |self| ... } click to toggle source
# File lib/project/motion_form.rb, line 8
def config
  yield self
end
form_for(view) { |form| ... } click to toggle source
# File lib/project/motion_form.rb, line 12
def form_for(view)
  MotionForm::Base.new.tap do |form|

    yield form if block_given?

    view.addSubview(form)

    %w(H V).each do |direction|
      constraints = NSLayoutConstraint.constraintsWithVisualFormat(
      "#{direction}:|[form]|",
      options: 0,
      metrics: nil,
      views: { 'form' => form } )

      view.addConstraints(constraints)
    end
  end
end
included_cells() click to toggle source
# File lib/project/motion_form.rb, line 39
def included_cells
  [TextInputCell, TextFieldCell, ButtonCell]
end
register_cell(cell) click to toggle source
# File lib/project/motion_form.rb, line 31
def register_cell(cell)
  registered_cells << cell
end
registered_cells() click to toggle source
# File lib/project/motion_form.rb, line 35
def registered_cells
  @registered_cells ||= included_cells
end
section_header_color() click to toggle source
# File lib/project/motion_form.rb, line 47
def section_header_color
  @section_header_color || '#EFEFF4'.to_color
end
section_header_font() click to toggle source
# File lib/project/motion_form.rb, line 43
def section_header_font
  @section_header_font || UIFont.fontWithName('HelveticaNeue', size: 14.0)
end
section_header_text_color() click to toggle source
# File lib/project/motion_form.rb, line 51
def section_header_text_color
  @section_header_text_color || '#232323'.to_color
end