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
240 241 242 |
# File 'lib/ProMotion/screen/screen_module.rb', line 240 def @nav_bar_button_args end |
#nav_bar_button(side, args = {}) ⇒ Object
235 236 237 238 |
# File 'lib/ProMotion/screen/screen_module.rb', line 235 def (side, args={}) @nav_bar_button_args = args @nav_bar_button_args[:side] = side end |
#status_bar(style = nil, args = {}) ⇒ Object
219 220 221 222 223 224 225 |
# File 'lib/ProMotion/screen/screen_module.rb', line 219 def (style=nil, args={}) if NSBundle.mainBundle.objectForInfoDictionaryKey('UIViewControllerBasedStatusBarAppearance').nil? PM.logger.warn("status_bar will have no effect unless you set 'UIViewControllerBasedStatusBarAppearance' to false in your info.plist") end @status_bar_style = style @status_bar_animation = args[:animation] if args[:animation] end |
#status_bar_animation ⇒ Object
231 232 233 |
# File 'lib/ProMotion/screen/screen_module.rb', line 231 def @status_bar_animation || UIStatusBarAnimationSlide end |
#status_bar_type ⇒ Object
227 228 229 |
# File 'lib/ProMotion/screen/screen_module.rb', line 227 def @status_bar_style || :default end |
#title(t = nil) ⇒ Object
195 196 197 198 199 200 201 202 203 |
# File 'lib/ProMotion/screen/screen_module.rb', line 195 def title(t=nil) if t && t.is_a?(String) == false PM.logger.deprecated "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." return raise StandardError end @title = t if t @title_type = :text if t @title ||= self.to_s end |
#title_image(t) ⇒ Object
209 210 211 212 |
# File 'lib/ProMotion/screen/screen_module.rb', line 209 def title_image(t) @title = t.is_a?(UIImage) ? t : UIImage.imageNamed(t) @title_type = :image end |
#title_type ⇒ Object
205 206 207 |
# File 'lib/ProMotion/screen/screen_module.rb', line 205 def title_type @title_type || :text end |
#title_view(t) ⇒ Object
214 215 216 217 |
# File 'lib/ProMotion/screen/screen_module.rb', line 214 def title_view(t) @title = t @title_type = :view end |