class ProMotion::Menu::Drawer

Public Class Methods

new(options={}) click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 9
def self.new(options={})
  menu = alloc.init
  menu.send(:auto_setup, options)
  menu
end

Public Instance Methods

auto_setup(options={}) click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 21
def auto_setup(options={})
  options[:to_show] ||= :pan_bezel
  options[:to_hide] ||= [:pan_center, :tap_center]
  shadow = options[:shadow] unless options[:shadow].nil?
  set_attributes self, options
  self.send(:setup) if self.respond_to?(:setup)
end
center()
Alias for: center_controller
center=(c)
Alias for: center_controller=
center_controller() click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 56
def center_controller
  self.centerViewController
end
Also aliased as: content_controller, center, content
center_controller=(c) click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 49
def center_controller=(c)
  self.centerViewController = prepare_controller_for_pm(c)
end
Also aliased as: content_controller=, center=, content=
content()
Alias for: center_controller
content=(c)
Alias for: center_controller=
content_controller()
Alias for: center_controller
content_controller=(c)
Alias for: center_controller=
controller(side) click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 71
def controller(side)
  return self.left_controller if side == :left
  return self.right_controller if side == :right
  self.center_controller if [:content, :center].include?(side)
end
controller=(side={}) click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 63
def controller=(side={})
  self.left_controller = side[:left] if side[:left]
  self.right_controller = side[:right] if side[:right]
  self.center_controller = side[:center] if side[:center]
  self.center_controller ||= side[:content] if side[:content]
end
Also aliased as: controllers=
controllers=(side={})
Alias for: controller=
init() click to toggle source
Calls superclass method
# File lib/ProMotion/menu/drawer.rb, line 15
def init
  super.tap do
    screen_init if respond_to?(:screen_init)
  end
end
left()
Alias for: left_controller
left=(c)
Alias for: left_controller=
left_controller() click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 34
def left_controller
  self.leftDrawerViewController
end
Also aliased as: left
left_controller=(c) click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 29
def left_controller=(c)
  self.leftDrawerViewController = prepare_controller_for_pm(c)
end
Also aliased as: left=
right()
Alias for: right_controller
right=(c)
Alias for: right_controller=
right_controller() click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 44
def right_controller
  self.rightDrawerViewController
end
Also aliased as: right
right_controller=(c) click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 39
def right_controller=(c)
  self.rightDrawerViewController = prepare_controller_for_pm(c)
end
Also aliased as: right=
shadow=(show_shadow) click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 77
def shadow=(show_shadow)
  self.setShowsShadow(show_shadow)
end

Protected Instance Methods

default_completion_block() click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 92
def default_completion_block
  -> (completed) { true }
end
prepare_controller_for_pm(controller) click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 83
def prepare_controller_for_pm(controller)
  unless controller.nil?
    controller = controller.new if controller.respond_to?(:new)
    controller = set_up_screen_for_open(controller, {})
    ensure_wrapper_controller_in_place(controller, {})
    controller.navigationController || controller
  end
end