Class: Nitron::StaticTableViewController

Inherits:
ViewController
  • Object
show all
Defined in:
lib/nitron/static_table_view_controller.rb

Instance Method Summary collapse

Methods inherited from ViewController

#close

Methods included from UI::ActionSupport

#_dispatch, #dealloc, included, #viewDidLoad

Methods included from UI::OutletSupport

#viewDidLoad

Methods included from UI::DataBindingSupport

#dealloc, #model, #model=, #viewDidLoad

Instance Method Details

#setValue(value, forKey: key) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/nitron/static_table_view_controller.rb', line 3

def setValue(value, forKey: key)
  if key == "staticDataSource"
    @_dataSource = value
  else
    super
  end
end

#tableView(tableView, heightForRowAtIndexPath: indexPath) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/nitron/static_table_view_controller.rb', line 11

def tableView(tableView, didSelectRowAtIndexPath:indexPath)
  cell = tableView.cellForRowAtIndexPath(indexPath)

  if outlet = cell.outlets.first
    handler = self.class.outletHandlers[outlet[0]]

    if handler
      self.instance_eval(&handler[:handler])
    end
  end
end

#viewWillAppear(animated) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/nitron/static_table_view_controller.rb', line 29

def viewWillAppear(animated)
  view.dataSource = @_dataSource
  view.delegate = self

  # The data binding module may wrap view.delegate, so run it after we've set up.
  super
end