Hi marc-8366,
Welcome to our Microsoft Q&A platform!
About Designing user interfaces with Xcode, you can refer to this document.
Usually, we only need to drag the control into the .h file as follows.
@property (nonatomic, retain) IBOutlet UIButton *btn;
which will generate the corresponding code in designer.cs.
[Outlet]
UIKit.UIButton btn{get; set;}
And now, you can subscribe to the event in ViewDidLoad.
public override void ViewDidLoad()
{
base.ViewDidLoad();
btn.TouchUpInside += Btn_TouchUpInside;
}
private void Btn_TouchUpInside(object sender, EventArgs e)
{
Console.WriteLine("Btn test");
}
Regards,
Kyle
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.