Creating your first iOS application with Xamarin Studio is remarkably easy. For now, let's just build a simple project as a point of reference, as shown in the following steps. We'll dig into the details later.
Within Xamarin Studio, navigate to File | New | Solution….
Choose the C# | iOS | iPhone group.
Choose the Single View Application project type.
Name your project
HelloiPhone
and click OK.Open the
HelloiPhoneViewController.cs
file.We'll explore some code examples in detail later, but for now just replace the
ViewDidLoad()
method with the following block of code:UILabellabelHello; public override void ViewDidLoad () { base.ViewDidLoad (); var frame = new RectangleF(10, 10, 300, 30); labelHello = new UILabel(frame); labelHello.Text = "Hello, iPhone!"; View.Add (labelHello); }
In the target dropdown, select iPhone Retina (4-inch) -> iOS 7.1.
Click the Build and Run button.
That's it! You've created your first iOS application using Xamarin...