Move GetTopViewController -> GetTopModalHostViewController to extension methods
Remove unnecessary methods from IMvxIosViewPresenter
This commit is contained in:
Родитель
9cdeab60ea
Коммит
ae21c26bb3
|
@ -176,5 +176,17 @@ namespace MvvmCross.iOS.Support.Views
|
|||
|
||||
return descendantViews;
|
||||
}
|
||||
|
||||
public virtual UIViewController GetTopModalHostViewController(this UIWindow window)
|
||||
{
|
||||
var vc = window.RootViewController;
|
||||
do {
|
||||
if (vc.PresentedViewController != null)
|
||||
vc = vc.PresentedViewController;
|
||||
|
||||
} while (vc.PresentedViewController != null);
|
||||
|
||||
return vc;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,13 +11,6 @@ using UIKit;
|
|||
namespace MvvmCross.iOS.Views.Presenters
|
||||
{
|
||||
public interface IMvxIosViewPresenter : IMvxViewPresenter, IMvxCanCreateIosView
|
||||
{
|
||||
void ShowModalViewController(UIViewController viewController, bool animated);
|
||||
|
||||
void CloseModalViewController(UIViewController viewController);
|
||||
|
||||
void CloseModalViewControllers();
|
||||
|
||||
UIViewController GetTopViewController();
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -532,18 +532,6 @@ namespace MvvmCross.iOS.Views.Presenters
|
|||
SplitViewController = null;
|
||||
}
|
||||
|
||||
public virtual UIViewController GetTopViewController()
|
||||
{
|
||||
var vc = UIApplication.SharedApplication.KeyWindow.RootViewController;
|
||||
do {
|
||||
if (vc.PresentedViewController != null)
|
||||
vc = vc.PresentedViewController;
|
||||
|
||||
} while (vc.PresentedViewController != null);
|
||||
|
||||
return vc;
|
||||
}
|
||||
|
||||
protected void RemoveWindowSubviews()
|
||||
{
|
||||
foreach (var v in _window.Subviews)
|
||||
|
|
Загрузка…
Ссылка в новой задаче