mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-06-02 14:58:31 +08:00
alias :main_controller method to :pm_main_controller
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user