class UnderOs::Page

UOS::Page is kind of a wrap over an iOS controller but instead of the controller, it presents more the main (root) view of the controller in a sence you've got for DOM documents in web

Attributes

_[R]
stylesheet[R]

Public Class Methods

layout(name=nil) click to toggle source
# File lib/under_os/page.rb, line 17
def self.layout(name=nil)
  name ? (@layout = name) : @layout
end
new(*args) click to toggle source
# File lib/under_os/page.rb, line 13
def self.new(*args)
  alloc.setup_wrap(*args)
end
new() click to toggle source
# File lib/under_os/page.rb, line 21
def initialize
  # page building goes in here
end

Public Instance Methods

alert(*args) click to toggle source
# File lib/under_os/page.rb, line 39
def alert(*args)
  Alert.new(*args)
end
build_layout() click to toggle source
# File lib/under_os/page.rb, line 95
def build_layout
  @_layout = Layout.new(self)
end
compile_styles() click to toggle source
# File lib/under_os/page.rb, line 99
def compile_styles
  @stylesheet = Stylesheet.new
  @stylesheet << UnderOs::App.stylesheet
  @stylesheet.load("#{name}.css")
end
history() click to toggle source
# File lib/under_os/page.rb, line 43
def history
  UnderOs::App.history
end
name() click to toggle source
# File lib/under_os/page.rb, line 59
def name
  self.class.name.underscore.sub(/_page$/, '')
end
navbar() click to toggle source
repaint() click to toggle source
# File lib/under_os/page.rb, line 105
def repaint
  view.repaint(stylesheet)   if view
  navbar.repaint(stylesheet) if navbar
end
setup_wrap(*args) click to toggle source
# File lib/under_os/page.rb, line 63
def setup_wrap(*args)
  @_ = UIViewControllerWrap.alloc.init(self, {
    on_load_view:      Proc.new{ emit('init')      },
    on_view_loaded:    Proc.new{ emit('load')      },
    on_view_preappear: Proc.new{ emit('preappear') },
    on_view_appear:    Proc.new{ emit('appear')    },
    on_view_disappear: Proc.new{ emit('disappear') },
    on_view_rerender:  Proc.new{ emit('rerender')  },
    on_view_rotate:    Proc.new{ emit('rotate')    }
  })

  on 'init' do
    build_layout
    compile_styles
  end

  on 'load' do
    repaint
    initialize(*args)
  end

  on 'preappear' do
    repaint
  end

  on 'rotate' do
    repaint
  end

  self
end
title() click to toggle source
# File lib/under_os/page.rb, line 51
def title
  @_.navigationItem.title
end
title=(text) click to toggle source
# File lib/under_os/page.rb, line 55
def title=(text)
  @_.navigationItem.title = text
end
view() click to toggle source
# File lib/under_os/page.rb, line 25
def view
  @_view
end
view=(view) click to toggle source
# File lib/under_os/page.rb, line 29
def view=(view)
  @_view = view
end