alias :main_controller method to :pm_main_controller

This commit is contained in:
Matt Brewer
2013-05-20 12:16:49 -04:00
parent 54c013c6d7
commit 0ed76baef3
2 changed files with 6 additions and 9 deletions

View File

@@ -140,10 +140,6 @@ module ProMotion
end
def on_disappear; end
def main_controller
self.navigation_controller || self
end
def view_controller
warn "[DEPRECATION] `view_controller` is deprecated, as screens are now UIViewController subclasses."
self

View File

@@ -1,9 +1,10 @@
module ProMotion
module BehavesLikeScreen
def pm_main_controller
respond_to?(:main_controller) ? main_controller : self
end
end
module BehavesLikeScreen
def pm_main_controller
navigationController || self
end
alias_method :main_controller, :pm_main_controller
end
end
UIViewController.send :include, ProMotion::BehavesLikeScreen