Sha256: 74120ec36072e6502328a0bc4e50a69a49abd0ad10570a7f519c23852f7c926a

Contents?: true

Size: 742 Bytes

Versions: 16

Compression:

Stored size: 742 Bytes

Contents

class UINavigationController

  def push(view_controller)
    self.pushViewController(view_controller, animated: true)
    self
  end

  def <<(view_controller)
    self.pushViewController(view_controller, animated: true)
    self
  end

  def pop(to_view=nil)
    return self.!(to_view) if to_view

    self.popViewControllerAnimated(true)
  end

  def !(to_view=nil)
    if to_view
      self.popToViewController(to_view, animated: true)
    else
      self.popToRootViewControllerAnimated(true)
    end
  end

end


class UITabBarController

  def <<(view_controller)
    view_controllers = [] + self.viewControllers
    view_controllers << view_controller
    self.setViewControllers(view_controllers, animated: true)
    self
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sugarcube-0.10 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.9.4 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.9.3 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.9.2 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.9.1 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.9 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.8.7 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.8.6 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.8.5 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.8.4 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.8.3 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.8.2 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.8.1 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.8 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.7.9 lib/sugarcube/uiviewcontroller.rb
sugarcube-0.7.7 lib/sugarcube/uiviewcontroller.rb