Module: Nitron::UI::DataBindingSupport

Included in:
ViewController
Defined in:
lib/nitron/ui/data_binding_support.rb

Instance Method Summary collapse

Instance Method Details

#deallocObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/nitron/ui/data_binding_support.rb', line 4

def dealloc
  if @_bindings
    @_bindings = nil
  end

  if @_model
    @_model = nil
  end

  super
end

#modelObject



16
17
18
# File 'lib/nitron/ui/data_binding_support.rb', line 16

def model
  @_model
end

#model=(model) ⇒ Object



20
21
22
23
24
# File 'lib/nitron/ui/data_binding_support.rb', line 20

def model=(model)
  @_model = model

  DataBinder.shared.bind(model, view)
end

#viewDidLoadObject



26
27
28
29
30
# File 'lib/nitron/ui/data_binding_support.rb', line 26

def viewDidLoad
  super

  @_bindings = DataBinder.shared.bind(model, view)
end