Class: UIViewController

Inherits:
Object show all
Defined in:
lib/project/ruby_motion_query/ext.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.rmq_style_sheet_classObject



149
150
151
# File 'lib/project/ruby_motion_query/ext.rb', line 149

def self.rmq_style_sheet_class
  @rmq_style_sheet_class
end

.stylesheet(style_sheet_class) ⇒ Object



146
147
148
# File 'lib/project/ruby_motion_query/ext.rb', line 146

def self.stylesheet(style_sheet_class)
  @rmq_style_sheet_class = style_sheet_class
end

Instance Method Details

#append(view_or_constant, style = nil, opts = {}) ⇒ Object



96
97
98
# File 'lib/project/ruby_motion_query/ext.rb', line 96

def append(view_or_constant, style=nil, opts = {})
  view.append(view_or_constant, style, opts)
end

#append!(view_or_constant, style = nil, opts = {}) ⇒ Object



99
100
101
# File 'lib/project/ruby_motion_query/ext.rb', line 99

def append!(view_or_constant, style=nil, opts = {})
  view.append!(view_or_constant, style, opts)
end

#build(view_or_constant, style = nil, opts = {}) ⇒ Object



117
118
119
# File 'lib/project/ruby_motion_query/ext.rb', line 117

def build(view_or_constant, style = nil, opts = {})
  view.build(view_or_constant, style, opts)
end

#build!(view_or_constant, style = nil, opts = {}) ⇒ Object



120
121
122
# File 'lib/project/ruby_motion_query/ext.rb', line 120

def build!(view_or_constant, style = nil, opts = {})
  view.build!(view_or_constant, style, opts)
end

#colorObject



128
129
130
# File 'lib/project/ruby_motion_query/ext.rb', line 128

def color
  rmq.color
end

#create(view_or_constant, style = nil, opts = {}) ⇒ Object



110
111
112
# File 'lib/project/ruby_motion_query/ext.rb', line 110

def create(view_or_constant, style=nil, opts = {})
  view.create(view_or_constant, style, opts)
end

#create!(view_or_constant, style = nil, opts = {}) ⇒ Object



113
114
115
# File 'lib/project/ruby_motion_query/ext.rb', line 113

def create!(view_or_constant, style=nil, opts = {})
  view.create!(view_or_constant, style, opts)
end

#didRotateFromInterfaceOrientation(orientation) ⇒ Object



225
226
227
# File 'lib/project/ruby_motion_query/ext.rb', line 225

def didRotateFromInterfaceOrientation(orientation)
  self.on_rotate orientation
end

#fontObject



132
133
134
# File 'lib/project/ruby_motion_query/ext.rb', line 132

def font
  rmq.font
end

#imageObject



136
137
138
# File 'lib/project/ruby_motion_query/ext.rb', line 136

def image
  rmq.image
end

#on_loadObject



153
154
# File 'lib/project/ruby_motion_query/ext.rb', line 153

def on_load
end

#on_rotate(orientation) ⇒ Object



223
224
# File 'lib/project/ruby_motion_query/ext.rb', line 223

def on_rotate(orientation)
end

#originalViewDidLoadObject

Monkey patch because I think that overriding viewDidLoad like this may be problematic



160
# File 'lib/project/ruby_motion_query/ext.rb', line 160

alias :originalViewDidLoad :viewDidLoad

#pm_handles_did_load?Boolean

Returns:

  • (Boolean)


176
177
178
# File 'lib/project/ruby_motion_query/ext.rb', line 176

def pm_handles_did_load?
  self.is_a?(ProMotion::ViewController) || self.is_a?(ProMotion::TableScreen)
end

#prepend(view_or_constant, style = nil, opts = {}) ⇒ Object



103
104
105
# File 'lib/project/ruby_motion_query/ext.rb', line 103

def prepend(view_or_constant, style=nil, opts = {})
  view.prepend(view_or_constant, style, opts)
end

#prepend!(view_or_constant, style = nil, opts = {}) ⇒ Object



106
107
108
# File 'lib/project/ruby_motion_query/ext.rb', line 106

def prepend!(view_or_constant, style=nil, opts = {})
  view.prepend!(view_or_constant, style, opts)
end

#reapply_stylesObject



124
125
126
# File 'lib/project/ruby_motion_query/ext.rb', line 124

def reapply_styles
  rmq.all.reapply_styles
end

#should_autorotateObject



210
211
212
# File 'lib/project/ruby_motion_query/ext.rb', line 210

def should_autorotate
  true
end

#should_rotate(orientation) ⇒ Object



204
205
# File 'lib/project/ruby_motion_query/ext.rb', line 204

def should_rotate(orientation)
end

#shouldAutorotateObject



213
214
215
# File 'lib/project/ruby_motion_query/ext.rb', line 213

def shouldAutorotate
  self.should_autorotate
end

#shouldAutorotateToInterfaceOrientation(orientation) ⇒ Object



206
207
208
# File 'lib/project/ruby_motion_query/ext.rb', line 206

def shouldAutorotateToInterfaceOrientation(orientation)
  self.should_rotate(orientation)
end

#stylesheetObject



140
141
142
# File 'lib/project/ruby_motion_query/ext.rb', line 140

def stylesheet
  rmq.stylesheet
end

#stylesheet=(value) ⇒ Object



143
144
145
# File 'lib/project/ruby_motion_query/ext.rb', line 143

def stylesheet=(value)
  rmq.stylesheet = value
end

#view_did_appear(animated) ⇒ Object



186
187
# File 'lib/project/ruby_motion_query/ext.rb', line 186

def view_did_appear(animated)
end

#view_did_disappear(animated) ⇒ Object



198
199
# File 'lib/project/ruby_motion_query/ext.rb', line 198

def view_did_disappear(animated)
end

#view_did_loadObject



156
157
# File 'lib/project/ruby_motion_query/ext.rb', line 156

def view_did_load
end

#view_will_appear(animated) ⇒ Object



180
181
# File 'lib/project/ruby_motion_query/ext.rb', line 180

def view_will_appear(animated)
end

#view_will_disappear(animated) ⇒ Object



192
193
# File 'lib/project/ruby_motion_query/ext.rb', line 192

def view_will_disappear(animated)
end

#viewDidAppear(animated) ⇒ Object



188
189
190
# File 'lib/project/ruby_motion_query/ext.rb', line 188

def viewDidAppear(animated)
  self.view_did_appear(animated)
end

#viewDidDisappear(animated) ⇒ Object



200
201
202
# File 'lib/project/ruby_motion_query/ext.rb', line 200

def viewDidDisappear(animated)
  self.view_did_disappear(animated)
end

#viewDidLoadObject



161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/project/ruby_motion_query/ext.rb', line 161

def viewDidLoad
  if self.class.rmq_style_sheet_class
    self.rmq.stylesheet = self.class.rmq_style_sheet_class
    self.view.rmq.apply_style :root_view
  end

  self.originalViewDidLoad
  unless pm_handles_did_load?
    unless self.class.included_modules.include?(ProMotion::ScreenModule)
      self.view_did_load
    end
    self.on_load
  end
end

#viewWillAppear(animated) ⇒ Object



182
183
184
# File 'lib/project/ruby_motion_query/ext.rb', line 182

def viewWillAppear(animated)
  self.view_will_appear(animated)
end

#viewWillDisappear(animated) ⇒ Object



194
195
196
# File 'lib/project/ruby_motion_query/ext.rb', line 194

def viewWillDisappear(animated)
  self.view_will_disappear(animated)
end

#will_animate_rotate(orientation, duration) ⇒ Object



229
230
# File 'lib/project/ruby_motion_query/ext.rb', line 229

def will_animate_rotate(orientation, duration)
end

#will_rotate(orientation, duration) ⇒ Object



217
218
# File 'lib/project/ruby_motion_query/ext.rb', line 217

def will_rotate(orientation, duration)
end

#willAnimateRotationToInterfaceOrientation(orientation, duration: duration) ⇒ Object



231
232
233
# File 'lib/project/ruby_motion_query/ext.rb', line 231

def willAnimateRotationToInterfaceOrientation(orientation, duration: duration)
  self.will_animate_rotate(orientation, duration)
end

#willRotateToInterfaceOrientation(orientation, duration: duration) ⇒ Object



219
220
221
# File 'lib/project/ruby_motion_query/ext.rb', line 219

def willRotateToInterfaceOrientation(orientation, duration:duration)
  self.will_rotate(orientation, duration)
end