Class: UIViewController

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.rmq_style_sheet_classObject



58
59
60
# File 'lib/project/ext/ui_view_controller.rb', line 58

def self.rmq_style_sheet_class
  @rmq_style_sheet_class
end

.stylesheet(style_sheet_class) ⇒ Object



54
55
56
# File 'lib/project/ext/ui_view_controller.rb', line 54

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



2
3
4
# File 'lib/project/ext/ui_view_controller.rb', line 2

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

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



5
6
7
# File 'lib/project/ext/ui_view_controller.rb', line 5

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

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



23
24
25
# File 'lib/project/ext/ui_view_controller.rb', line 23

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

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



26
27
28
# File 'lib/project/ext/ui_view_controller.rb', line 26

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

#colorObject



34
35
36
# File 'lib/project/ext/ui_view_controller.rb', line 34

def color
  rmq.color
end

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



16
17
18
# File 'lib/project/ext/ui_view_controller.rb', line 16

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

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



19
20
21
# File 'lib/project/ext/ui_view_controller.rb', line 19

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

#didRotateFromInterfaceOrientation(orientation) ⇒ Object



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

def didRotateFromInterfaceOrientation(orientation)
  self.on_rotate orientation
end

#fontObject



38
39
40
# File 'lib/project/ext/ui_view_controller.rb', line 38

def font
  rmq.font
end

#imageObject



42
43
44
# File 'lib/project/ext/ui_view_controller.rb', line 42

def image
  rmq.image
end

#on_loadObject



62
63
# File 'lib/project/ext/ui_view_controller.rb', line 62

def on_load
end

#on_rotate(orientation) ⇒ Object



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

def on_rotate(orientation)
end

#originalViewDidLoadObject

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



69
# File 'lib/project/ext/ui_view_controller.rb', line 69

alias :originalViewDidLoad :viewDidLoad

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



9
10
11
# File 'lib/project/ext/ui_view_controller.rb', line 9

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

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



12
13
14
# File 'lib/project/ext/ui_view_controller.rb', line 12

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

#reapply_stylesObject



30
31
32
# File 'lib/project/ext/ui_view_controller.rb', line 30

def reapply_styles
  rmq.all.reapply_styles
end

#should_autorotateObject



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

def should_autorotate
  true
end

#should_rotate(orientation) ⇒ Object



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

def should_rotate(orientation)
end

#shouldAutorotateObject



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

def shouldAutorotate
  self.should_autorotate
end

#shouldAutorotateToInterfaceOrientation(orientation) ⇒ Object



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

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

#stylesheetObject



46
47
48
# File 'lib/project/ext/ui_view_controller.rb', line 46

def stylesheet
  rmq.stylesheet
end

#stylesheet=(value) ⇒ Object



50
51
52
# File 'lib/project/ext/ui_view_controller.rb', line 50

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

#view_did_appear(animated) ⇒ Object



94
95
# File 'lib/project/ext/ui_view_controller.rb', line 94

def view_did_appear(animated)
end

#view_did_disappear(animated) ⇒ Object



112
113
# File 'lib/project/ext/ui_view_controller.rb', line 112

def view_did_disappear(animated)
end

#view_did_loadObject



65
66
# File 'lib/project/ext/ui_view_controller.rb', line 65

def view_did_load
end

#view_will_appear(animated) ⇒ Object



85
86
# File 'lib/project/ext/ui_view_controller.rb', line 85

def view_will_appear(animated)
end

#view_will_disappear(animated) ⇒ Object



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

def view_will_disappear(animated)
end

#viewDidAppear(animated) ⇒ Object



97
98
99
100
101
# File 'lib/project/ext/ui_view_controller.rb', line 97

def viewDidAppear(animated)
  unless pm_handles_delegates?
    self.view_did_appear(animated)
  end
end

#viewDidDisappear(animated) ⇒ Object



115
116
117
118
119
# File 'lib/project/ext/ui_view_controller.rb', line 115

def viewDidDisappear(animated)
  unless pm_handles_delegates?
    self.view_did_disappear(animated)
  end
end

#viewDidLoadObject



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/project/ext/ui_view_controller.rb', line 70

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) if self.rmq.stylesheet.respond_to?(:root_view)
  end

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

#viewWillAppear(animated) ⇒ Object



88
89
90
91
92
# File 'lib/project/ext/ui_view_controller.rb', line 88

def viewWillAppear(animated)
  unless pm_handles_delegates?
    self.view_will_appear(animated)
  end
end

#viewWillDisappear(animated) ⇒ Object



106
107
108
109
110
# File 'lib/project/ext/ui_view_controller.rb', line 106

def viewWillDisappear(animated)
  unless pm_handles_delegates?
    self.view_will_disappear(animated)
  end
end

#will_animate_rotate(orientation, duration) ⇒ Object



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

def will_animate_rotate(orientation, duration)
end

#will_rotate(orientation, duration) ⇒ Object



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

def will_rotate(orientation, duration)
end

#willAnimateRotationToInterfaceOrientation(orientation, duration: duration) ⇒ Object



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

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

#willRotateToInterfaceOrientation(orientation, duration: duration) ⇒ Object



139
140
141
# File 'lib/project/ext/ui_view_controller.rb', line 139

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