lib/ProMotion/screen/screen_navigation.rb in ProMotion-2.0.0.rc5 vs lib/ProMotion/screen/screen_navigation.rb in ProMotion-2.0.0
- old
+ new
@@ -45,11 +45,11 @@
close_nav_screen args if self.navigationController
close_modal_screen args
elsif self.navigationController
close_nav_screen args
- send_on_return(args) # TODO: this would be better implemented in a callback or view_did_disappear.
+ send_on_return(args)
else
PM.logger.warn "Tried to close #{self.to_s}; however, this screen isn't modal or in a nav bar."
end
@@ -136,9 +136,10 @@
end
def close_nav_screen(args={})
args[:animated] = true unless args.has_key?(:animated)
if args[:to_screen] == :root
+ self.parent_screen = self.navigationController.viewControllers.first
self.navigationController.popToRootViewControllerAnimated args[:animated]
elsif args[:to_screen] && args[:to_screen].is_a?(UIViewController)
self.parent_screen = args[:to_screen]
self.navigationController.popToViewController(args[:to_screen], animated: args[:animated])
else