Class: ProMotion::SplitViewController

Inherits:
UISplitViewController
  • Object
show all
Defined in:
lib/ProMotion/cocoatouch/split_view_controller.rb

Instance Method Summary collapse

Instance Method Details

#detail_screenObject



8
9
10
11
# File 'lib/ProMotion/cocoatouch/split_view_controller.rb', line 8

def detail_screen
  s = self.viewControllers.last
  s.respond_to?(:visibleViewController) ? s.visibleViewController : s
end

#detail_screen=(s) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/ProMotion/cocoatouch/split_view_controller.rb', line 17

def detail_screen=(s)
  # set the button from the old detail screen to the new one
  button = detail_screen.navigationItem.leftBarButtonItem
  s.navigationItem.leftBarButtonItem = button

  self.viewControllers = [self.viewControllers.first, (s.navigationController || s)]
end

#master_screenObject



3
4
5
6
# File 'lib/ProMotion/cocoatouch/split_view_controller.rb', line 3

def master_screen
  s = self.viewControllers.first
  s.respond_to?(:visibleViewController) ? s.visibleViewController : s
end

#master_screen=(s) ⇒ Object



13
14
15
# File 'lib/ProMotion/cocoatouch/split_view_controller.rb', line 13

def master_screen=(s)
  self.viewControllers = [ (s.navigationController || s), self.viewControllers.last]
end

#screens=(s_array) ⇒ Object



25
26
27
# File 'lib/ProMotion/cocoatouch/split_view_controller.rb', line 25

def screens=(s_array)
  self.viewControllers = s_array
end