当modal被解雇时

时间:2015-03-24 13:04:42

标签: ios xamarin

当我在MainViewController

中弹出一个模态时,我有这段代码
ModalViewController controller = Storyboard.InstantiateViewController ("ModalViewController") as ModalViewController;
this.PresentViewController(controller,true,null);

并且在我的ModalViewController的另一端,我在这里有一个事件,这将被解雇。我使用这段代码。 DismissViewController(true,null);我的MainViewController可以在我的模态被解除时捕获事件吗?

2 个答案:

答案 0 :(得分:0)

,您需要使用委托模式来处理它。如果您是代表新手,请查看此处delegation in Swift

答案 1 :(得分:0)

您也可以使用Xamarin pub / sub MessagingCenter:http://developer.xamarin.com/guides/cross-platform/xamarin-forms/messaging-center/

相关问题