module ProMotion::DelegateModule

Attributes

home_screen[RW]
window[RW]

Public Class Methods

included(base) click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 141
def self.included(base)
  base.extend(ClassMethods)
end

Public Instance Methods

application(application, willFinishLaunchingWithOptions:launch_options) click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 9
def application(application, willFinishLaunchingWithOptions:launch_options)
  will_load(application, launch_options) if respond_to?(:will_load)
  true
end
applicationDidBecomeActive(application) click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 21
def applicationDidBecomeActive(application)
  try :on_activate
end
applicationDidEnterBackground(application) click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 29
def applicationDidEnterBackground(application)
  try :on_enter_background
end
applicationWillEnterForeground(application) click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 33
def applicationWillEnterForeground(application)
  try :will_enter_foreground
end
applicationWillResignActive(application) click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 25
def applicationWillResignActive(application)
  try :will_deactivate
end
applicationWillTerminate(application) click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 37
def applicationWillTerminate(application)
  try :on_unload
end
open(screen, args={}) click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 53
def open(screen, args={})
  screen = set_up_screen_for_open(screen, args)

  self.home_screen = screen

  self.window ||= self.ui_window.alloc.initWithFrame(UIScreen.mainScreen.bounds)
  self.window.rootViewController = (screen.navigationController || screen)
  self.window.tintColor = self.class.send(:get_tint_color) if self.window.respond_to?("tintColor=")
  self.window.makeKeyAndVisible

  screen
end
Also aliased as: open_screen
open_root_screen(screen, args={})
Alias for: open_screen
open_screen(screen, args={})
Also aliased as: open_root_screen
Alias for: open
set_up_screen_for_open(screen, args={}) click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 68
def set_up_screen_for_open(screen, args={})
  # Instantiate screen if given a class
  screen = screen.new(args) if screen.respond_to?(:new)

  # Store screen options
  screen.screen_options.merge(args) if screen.respond_to?(:screen_options)

  # Set title & modal properties
  screen.title = args[:title] if args[:title] && screen.respond_to?(:title=)
  screen.modal = args[:modal] if args[:modal] && screen.respond_to?(:modal=)

  # Hide bottom bar?
  screen.hidesBottomBarWhenPushed = args[:hide_tab_bar] == true

  # Wrap in a PM::NavigationController?
  screen.add_nav_bar(args) if screen.respond_to?(:add_nav_bar)

  # Return modified screen instance
  screen
end
status_bar?() click to toggle source

DEPRECATED

# File lib/ProMotion/delegate/delegate_module.rb, line 90
def status_bar?
  mp "The default behavior of `status_bar?` has changed. Calling `status_bar?` on AppDelegate may not return the correct result.", force_color: :yellow
  self.class.status_bar_style != :hidden
end
status_bar_animation() click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 99
def status_bar_animation
  self.class.status_bar_animation
end
status_bar_style() click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 95
def status_bar_style
  self.class.status_bar_style
end
ui_window() click to toggle source
# File lib/ProMotion/delegate/delegate_module.rb, line 49
def ui_window
  (defined?(Motion) && defined?(Motion::Xray) && defined?(Motion::Xray::XrayWindow)) ? Motion::Xray::XrayWindow : UIWindow
end