Module: ProMotion::ScreenModule::ClassMethods
- Defined in:
- lib/ProMotion/screen/screen_module.rb
Instance Method Summary collapse
- #get_nav_bar ⇒ Object
- #get_nav_bar_button ⇒ Object
- #nav_bar(enabled, args = {}) ⇒ Object
- #nav_bar_button(side, args = {}) ⇒ Object
- #title(t = nil) ⇒ Object
- #title_image(t) ⇒ Object
- #title_type ⇒ Object
- #title_view(t) ⇒ Object
Instance Method Details
#get_nav_bar ⇒ Object
229 230 231 |
# File 'lib/ProMotion/screen/screen_module.rb', line 229 def @nav_bar_args ||= { nav_bar: false } end |
#get_nav_bar_button ⇒ Object
240 241 242 |
# File 'lib/ProMotion/screen/screen_module.rb', line 240 def @nav_bar_button_args ||= [] end |
#nav_bar(enabled, args = {}) ⇒ Object
225 226 227 |
# File 'lib/ProMotion/screen/screen_module.rb', line 225 def (enabled, args={}) @nav_bar_args = ({ nav_bar: enabled }).merge(args) end |
#nav_bar_button(side, args = {}) ⇒ Object
233 234 235 236 237 238 |
# File 'lib/ProMotion/screen/screen_module.rb', line 233 def (side, args={}) = args.merge(:side => side) @nav_bar_button_args ||= [] @nav_bar_button_args << end |
#title(t = nil) ⇒ Object
201 202 203 204 205 206 207 208 209 |
# File 'lib/ProMotion/screen/screen_module.rb', line 201 def title(t=nil) if t && t.is_a?(String) == false mp "You're trying to set the title of #{self.to_s} to an instance of #{t.class.to_s}. In ProMotion 2+, you must use `title_image` or `title_view` instead.", force_color: :yellow return raise StandardError end @title = t if t @title_type = :text if t @title end |
#title_image(t) ⇒ Object
215 216 217 218 |
# File 'lib/ProMotion/screen/screen_module.rb', line 215 def title_image(t) @title = t.is_a?(UIImage) ? t : UIImage.imageNamed(t) @title_type = :image end |
#title_type ⇒ Object
211 212 213 |
# File 'lib/ProMotion/screen/screen_module.rb', line 211 def title_type @title_type || :text end |
#title_view(t) ⇒ Object
220 221 222 223 |
# File 'lib/ProMotion/screen/screen_module.rb', line 220 def title_view(t) @title = t @title_type = :view end |