lib/ProMotion/screen/screen_navigation.rb in ProMotion-2.4.0 vs lib/ProMotion/screen/screen_navigation.rb in ProMotion-2.4.1
- old
+ new
@@ -45,12 +45,11 @@
elsif self.navigationController
close_nav_screen args
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."
-
+ mp "Tried to close #{self.to_s}; however, this screen isn't modal or in a nav bar.", force_color: :yellow
end
end
alias :close :close_screen
def send_on_return(args = {})
@@ -60,17 +59,17 @@
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."
+ mp "#{self.parent_screen.inspect} has an `on_return` method, but it is private and not callable from the closing screen.", force_color: :yellow
end
end
def push_view_controller(vc, nav_controller=nil, animated=true)
unless self.navigationController
- PM.logger.error "You need a nav_bar if you are going to push #{vc.to_s} onto it."
+ mp "You need a nav_bar if you are going to push #{vc.to_s} onto it.", force_color: :red
end
nav_controller ||= self.navigationController
return if nav_controller.topViewController == vc
vc.first_screen = false if vc.respond_to?(:first_screen=)
nav_controller.pushViewController(vc, animated: animated)
@@ -112,10 +111,10 @@
self.presentViewController((screen.navigationController || screen), animated: args[:animated], completion: args[:completion])
end
def open_in_tab(screen, tab_name)
vc = open_tab(tab_name)
- return PM.logger.error("No tab bar item '#{tab_name}'") && nil unless vc
+ return mp("No tab bar item '#{tab_name}'", force_color: :red) && nil unless vc
if vc.is_a?(UINavigationController)
push_view_controller(screen, vc)
else
replace_view_controller(screen, vc)
end