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.



111
112
113
# File 'lib/under_os/page.rb', line 111

def wrapper
  @wrapper
end

Instance Method Details

#didRotateFromInterfaceOrientation(orientation) ⇒ Object



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

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

#init(wrapper, options) ⇒ Object



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

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

#loadViewObject



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

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

#prefersStatusBarHiddenObject



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

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

#touchesBegan(touches, withEvent: event) ⇒ Object



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

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

#touchesCancelled(touches, withEvent: event) ⇒ Object



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

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

#touchesEnded(touches, withEvent: event) ⇒ Object



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

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

#touchesMoved(touches, withEvent: event) ⇒ Object



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

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

#viewDidAppear(animated) ⇒ Object



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

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

#viewDidDisappear(animated) ⇒ Object



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

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

#viewDidLoadObject



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

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

#viewWillLayoutSubviewsObject



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

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