Xamarin.iOS Hello, World


Example

  1. Double click on the Main.Storyboard file.
  2. Set View As to iPhone 6:enter image description here
  3. Drag a label and a button from the Toolbox to the design surface so that it looks like the image below:enter image description here
  4. In the Properties pad, give the label and button the following properties:
nothingNameTitle
LabellblClicks[blank]
ButtonclickMeClick Me!
  1. Add the following code to the ViewDidLoad method inside the ViewController class:
clickMe.TouchUpInside += (sender, e) =>
{
    totalClicks++;
    if (totalClicks == 1)
    {
        lblClicks.Text = totalClicks + " Click";
    }
    
   else {
       lblClicks.Text = totalClicks + " Clicks";
   }
};
  1. Run the application