Module: ProMotion::ScreenModule::ClassMethods
- Defined in:
- lib/ProMotion/screen/screen_module.rb
Overview
Class methods
Instance Method Summary collapse
- #get_nav_bar_button ⇒ Object
- #nav_bar_button(side, args = {}) ⇒ Object
- #status_bar(style = nil, args = {}) ⇒ Object
- #status_bar_animation ⇒ Object
- #status_bar_type ⇒ Object
- #title(t = nil) ⇒ Object
- #title_image(t) ⇒ Object
- #title_type ⇒ Object
- #title_view(t) ⇒ Object
Instance Method Details
#get_nav_bar_button ⇒ Object
259 260 261 |
# File 'lib/ProMotion/screen/screen_module.rb', line 259 def @nav_bar_button_args end |
#nav_bar_button(side, args = {}) ⇒ Object
254 255 256 257 |
# File 'lib/ProMotion/screen/screen_module.rb', line 254 def (side, args={}) @nav_bar_button_args = args @nav_bar_button_args[:side] = side end |
#status_bar(style = nil, args = {}) ⇒ Object
238 239 240 241 242 243 244 |
# File 'lib/ProMotion/screen/screen_module.rb', line 238 def (style=nil, args={}) if NSBundle.mainBundle.objectForInfoDictionaryKey('UIViewControllerBasedStatusBarAppearance').nil? mp "status_bar will have no effect unless you set 'UIViewControllerBasedStatusBarAppearance' to false in your info.plist", force_color: :yellow end @status_bar_style = style @status_bar_animation = args[:animation] if args[:animation] end |
#status_bar_animation ⇒ Object
250 251 252 |
# File 'lib/ProMotion/screen/screen_module.rb', line 250 def @status_bar_animation || UIStatusBarAnimationSlide end |
#status_bar_type ⇒ Object
246 247 248 |
# File 'lib/ProMotion/screen/screen_module.rb', line 246 def @status_bar_style || :default end |
#title(t = nil) ⇒ Object
214 215 216 217 218 219 220 221 222 |
# File 'lib/ProMotion/screen/screen_module.rb', line 214 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 ||= self.to_s end |
#title_image(t) ⇒ Object
228 229 230 231 |
# File 'lib/ProMotion/screen/screen_module.rb', line 228 def title_image(t) @title = t.is_a?(UIImage) ? t : UIImage.imageNamed(t) @title_type = :image end |
#title_type ⇒ Object
224 225 226 |
# File 'lib/ProMotion/screen/screen_module.rb', line 224 def title_type @title_type || :text end |
#title_view(t) ⇒ Object
233 234 235 236 |
# File 'lib/ProMotion/screen/screen_module.rb', line 233 def title_view(t) @title = t @title_type = :view end |