Sha256: 0a40e829b25d427e575e4efb9b408e161d3a5933aeca1d9c5876298fd08b26b8

Contents?: true

Size: 859 Bytes

Versions: 29

Compression:

Stored size: 859 Bytes

Contents

module ProMotion
  class SplitViewController < UISplitViewController
    def master_screen
      s = self.viewControllers.first
      s.respond_to?(:visibleViewController) ? s.visibleViewController : s
    end

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

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

    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

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

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
ProMotion-3.0.0 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.8.2 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.8.1 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.8.0 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.7.1 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.7.0 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.6.1 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.6.0 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.5.0 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.5.0.beta1 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.4.2 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.4.1 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.4.0 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.3.1 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.3.0 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.2.2 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.2.1 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.2.0 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.1.0 lib/ProMotion/cocoatouch/split_view_controller.rb
ProMotion-2.1.0.beta1 lib/ProMotion/cocoatouch/split_view_controller.rb