iOS - Calling App Delegate method from ViewController

前端 未结 13 906
鱼传尺愫
鱼传尺愫 2020-11-28 00:29

What I am trying to do is click a button (that was created in code) and have it call up a different view controller then have it run a function in the new view controller.

13条回答
  •  失恋的感觉
    2020-11-28 01:30

    If someone need the same in Xamarin (Xamarin.ios / Monotouch), this worked for me:

    var myDelegate = UIApplication.SharedApplication.Delegate as AppDelegate;
    

    (Require using UIKit;)

提交回复
热议问题