Class: UnderOs::Page::UIViewControllerWrap

Inherits:
UIViewController
  • Object
show all
Defined in:
lib/under_os/page.rb

Overview

A simple wrap over UIViewController to intercept the iOS events

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#wrapperObject (readonly)

Returns the value of attribute wrapper.



115
116
117
# File 'lib/under_os/page.rb', line 115

def wrapper
  @wrapper
end

Instance Method Details

#didRotateFromInterfaceOrientation(orientation) ⇒ Object



153
154
155
156
# File 'lib/under_os/page.rb', line 153

def didRotateFromInterfaceOrientation(orientation)
  super
  @options[:on_view_rotate].call
end

#init(wrapper, options) ⇒ Object



117
118
119
120
121
# File 'lib/under_os/page.rb', line 117

def init(wrapper, options)
  @wrapper = wrapper
  @options = options
  initWithNibName(nil, bundle: nil)
end

#loadViewObject



123
124
125
126
# File 'lib/under_os/page.rb', line 123

def loadView
  super
  @options[:on_load_view].call
end

#prefersStatusBarHiddenObject



158
159
160
# File 'lib/under_os/page.rb', line 158

def prefersStatusBarHidden
  !UnderOs::App.config.status_bar
end

#touchesBegan(touches, withEvent: event) ⇒ Object



162
163
164
# File 'lib/under_os/page.rb', line 162

def touchesBegan(touches, withEvent:event)
  UnderOs::UI::Events::TouchListeners.notify :touchstart, event
end

#touchesCancelled(touches, withEvent: event) ⇒ Object



174
175
176
# File 'lib/under_os/page.rb', line 174

def touchesCancelled(touches, withEvent: event)
  UnderOs::UI::Events::TouchListeners.notify :touchcancel, event
end

#touchesEnded(touches, withEvent: event) ⇒ Object



170
171
172
# File 'lib/under_os/page.rb', line 170

def touchesEnded(touches, withEvent: event)
  UnderOs::UI::Events::TouchListeners.notify :touchend, event
end

#touchesMoved(touches, withEvent: event) ⇒ Object



166
167
168
# File 'lib/under_os/page.rb', line 166

def touchesMoved(touches, withEvent:event)
  UnderOs::UI::Events::TouchListeners.notify :touchmove, event
end

#viewDidAppear(animated) ⇒ Object



138
139
140
141
# File 'lib/under_os/page.rb', line 138

def viewDidAppear(animated)
  super
  @options[:on_view_appear].call
end

#viewDidDisappear(animated) ⇒ Object



143
144
145
146
# File 'lib/under_os/page.rb', line 143

def viewDidDisappear(animated)
  super
  @options[:on_view_disappear].call
end

#viewDidLoadObject



128
129
130
131
# File 'lib/under_os/page.rb', line 128

def viewDidLoad
  super
  @options[:on_view_loaded].call
end

#viewWillAppear(animated) ⇒ Object



133
134
135
136
# File 'lib/under_os/page.rb', line 133

def viewWillAppear(animated)
  super(animated)
  @options[:on_view_preappear].call
end

#viewWillLayoutSubviewsObject



148
149
150
151
# File 'lib/under_os/page.rb', line 148

def viewWillLayoutSubviews
  super
  @options[:on_view_rerender].call
end