lib/ProMotion/cocoatouch/navigation_controller.rb in ProMotion-2.0.1 vs lib/ProMotion/cocoatouch/navigation_controller.rb in ProMotion-2.1.0.beta1
- old
+ new
@@ -1,12 +1,10 @@
module ProMotion
class NavigationController < UINavigationController
def popViewControllerAnimated(animated)
- if self.viewControllers[-2].respond_to? :on_back
- self.viewControllers[-2].send(:on_back)
- end
- super animated
+ super
+ self.viewControllers.last.send(:on_back) if self.viewControllers.last.respond_to?(:on_back)
end
def shouldAutorotate
visibleViewController.shouldAutorotate
end