Class: Tgios::BindingBase
- Inherits:
-
Object
- Object
- Tgios::BindingBase
show all
- Defined in:
- lib/tgios/binding_base.rb
Direct Known Subclasses
BeaconManager, ImageLoader, PhotoUpload, TableSectionListBinding, UIButtonBinding, UICollectionViewBinding, UIPickerViewListBinding, UITableViewListBinding, UITableViewModelBinding, UITableViewModelListBinding, UITableViewUtilityBinding, UITextFieldBinding, UITextViewBinding
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BindingBase.
3
4
5
|
# File 'lib/tgios/binding_base.rb', line 3
def initialize(*arg)
@hook_bindings = []
end
|
Instance Method Details
#dealloc ⇒ Object
32
33
34
35
|
# File 'lib/tgios/binding_base.rb', line 32
def dealloc
ap "#{self.class.name} dealloc"
super
end
|
#hook(control, event, &block) ⇒ Object
16
17
18
19
20
21
22
23
24
|
# File 'lib/tgios/binding_base.rb', line 16
def hook(control, event, &block)
binding=if control.is_a?(UIButton)
UIButtonBinding.new.bind(control).on(event, &block)
end
@hook_bindings << binding
binding
end
|
#onPrepareForRelease ⇒ Object
12
13
14
|
# File 'lib/tgios/binding_base.rb', line 12
def onPrepareForRelease
raise NotImplementedError.new("prepareForRelease not overridden for class #{self.class.name}")
end
|
#prepareForRelease ⇒ Object
7
8
9
10
|
# File 'lib/tgios/binding_base.rb', line 7
def prepareForRelease
@hook_bindings = nil
onPrepareForRelease
end
|
#unhook(control, event) ⇒ Object
26
27
28
29
30
|
# File 'lib/tgios/binding_base.rb', line 26
def unhook(control, event)
if control.is_a?(UIButton)
UIButtonBinding.unbind(control)
end
end
|