diff --git a/lib/ProMotion/cocoatouch/NavigationController.rb b/lib/ProMotion/cocoatouch/NavigationController.rb index e702a29..cb71fd3 100644 --- a/lib/ProMotion/cocoatouch/NavigationController.rb +++ b/lib/ProMotion/cocoatouch/NavigationController.rb @@ -1,7 +1,15 @@ module ProMotion - class NavigationController < UINavigationController - def shouldAutorotate - visibleViewController.shouldAutorotate - end - end + class NavigationController < UINavigationController + def shouldAutorotate + visibleViewController.shouldAutorotate + end + + def supportedInterfaceOrientations + visibleViewController.supportedInterfaceOrientations + end + + def preferredInterfaceOrientationForPresentation + visibleViewController.preferredInterfaceOrientationForPresentation + end + end end diff --git a/lib/ProMotion/delegate/delegate_helper.rb b/lib/ProMotion/delegate/delegate_helper.rb index 97cb02b..ccb75fd 100644 --- a/lib/ProMotion/delegate/delegate_helper.rb +++ b/lib/ProMotion/delegate/delegate_helper.rb @@ -16,6 +16,7 @@ module ProMotion # Workaround for now. Will display a NoMethodError, but ignore. super rescue true + PM.logger.info "You can ignore the NoMethodError -- this is a RubyMotion bug that should be fixed soon." end def applicationWillTerminate(application) diff --git a/lib/ProMotion/helpers/logger.rb b/lib/ProMotion/helpers/logger.rb index 58449e8..108dc67 100644 --- a/lib/ProMotion/helpers/logger.rb +++ b/lib/ProMotion/helpers/logger.rb @@ -33,7 +33,7 @@ module ProMotion # Usage: PM.logger.log("ERROR", "message here", :red) def log(label, message_text, color) - return if RUBYMOTION_ENV == "test" + return if defined?(RUBYMOTION_ENV) && RUBYMOTION_ENV == "test" color = COLORS[color] || COLORS[:default] puts color[0] + NAME + "[#{label}] #{message_text}" + color[1] end diff --git a/lib/ProMotion/screen_helpers/screen_navigation.rb b/lib/ProMotion/screen_helpers/screen_navigation.rb index 65fe30c..7756b8f 100644 --- a/lib/ProMotion/screen_helpers/screen_navigation.rb +++ b/lib/ProMotion/screen_helpers/screen_navigation.rb @@ -50,6 +50,7 @@ module ProMotion def close_screen(args = {}) args ||= {} + args = { sender: args } unless args.is_a?(Hash) args[:animated] ||= true if self.modal?