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_controller()
click to toggle source
# File lib/ProMotion/menu/drawer.rb, line 56 def center_controller self.centerViewController end
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
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=
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_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_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