Module: Lotion::Application

Includes:
Notifications
Defined in:
lib/lotion/application.rb

Instance Method Summary collapse

Methods included from Notifications

#notification_center, #notify

Instance Method Details

#application(application, didFinishLaunchingWithOptions: launchOptions) ⇒ Object



35
36
37
# File 'lib/lotion/application.rb', line 35

def application( application, didFinishLaunchingWithOptions:launchOptions )
  notify 'application:startup', launchOptions
end

#on(name, command) ⇒ Object



22
23
24
25
# File 'lib/lotion/application.rb', line 22

def on( name, command )
  notification_center.addObserver command,
    selector:'call:', name:name, object:nil
end

#screenObject



10
11
12
# File 'lib/lotion/application.rb', line 10

def screen
  UIScreen.mainScreen
end

#viewsObject



29
30
31
# File 'lib/lotion/application.rb', line 29

def views
  @views ||= Hash.new { |h, k| h[ k ] = k.alloc.init }
end

#windowObject



16
17
18
# File 'lib/lotion/application.rb', line 16

def window
  @window ||= UIWindow.alloc.initWithFrame screen.bounds
end