lib/ProMotion/screen/screen_navigation.rb in ProMotion-2.2.1 vs lib/ProMotion/screen/screen_navigation.rb in ProMotion-2.2.2

- old
+ new

@@ -59,15 +59,18 @@ end end alias :close :close_screen def send_on_return(args = {}) - if self.parent_screen && self.parent_screen.respond_to?(:on_return) + return unless self.parent_screen + if self.parent_screen.respond_to?(:on_return) if args && self.parent_screen.method(:on_return).arity != 0 self.parent_screen.send(:on_return, args) else self.parent_screen.send(:on_return) end + elsif self.parent_screen.private_methods.include?(:on_return) + PM.logger.warn "#{self.parent_screen.inspect} has an `on_return` method, but it is private and not callable from the closing screen." end end def push_view_controller(vc, nav_controller=nil, animated=true) unless self.navigationController