Sha256: 17d06425896fed9f41326ce6613b2f9074725e58f2fe4d1a938347a05a3e18c8

Contents?: true

Size: 691 Bytes

Versions: 1

Compression:

Stored size: 691 Bytes

Contents

#= require lotion/command
#= require lotion/notifications

module Lotion
  module Application
    include Lotion::Notifications

    ##
    #
    def screen
      UIScreen.mainScreen
    end

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

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

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lotion-0.1.0 lib/lotion/application.rb