The steps given below are required to be followed in order to validate an Email address in Xamarin iOS, using Xamarin Studio.
Step 1
Go to Xamarin Studio.
Click New Solution—> select Multiplatform—> Choose Single View app. Native(iOS, Android). Afterwards, click Next.
Step 2
In this step, configure your app. Give app name (Ex:sample) and Organization Identifier and Choose Target Platforms. Now, choose Shared code. Afterwards, click Next.
Step 3
In this step, give your Project Name(Ex: Sample) and Solution Name(EX: Sample). Give the path of your project. Afterwards, click Create.
Step 4
Subsequently, go to Solution . In Solution, get all the files and source in your project. Now, select Main.storyboard and double click to open Main.storyboard page.
Step 5
After opening Main.storyboard, you can design the page, as per your desire.
Step 6
Now, go to Toolbox Window. In Toolbox Window, get all the types of the tools and controls you need to go to Toolbox Window.
Now, scroll down and you will see all the tools and controls. You need to drag and drop Text Field. Now, you need to align Text Field, using constraints.
Step 7
Now, go to the Properties Window. Select Text Field and give Name (Ex:txtEmail).
Step 8
You need to drag and drop the label.
Now, you need to align the label, using the constraints.
Step 9
Now, go to Properties Window. Select Label and give the name (Ex:lblMessage).
Step 10
You need to drag and drop the button.
Now, you need to align the button, using constraints.
Step 11
Now, go to Properties Window. Select the button and give the name (Ex:btnValidate).
Step 12
In this step, go to ViewController.cs page. Write the code given below.
ViewController.cs
Step 13
Now, go to Run option. Choose Debug and the List of iPhone, available iPad Simulators. You can choose any one and run it.
Output
After a few seconds, the app will start running on your iPhone Simulator. You will see your app works successfully.
If you give the wrong format Email address, it will display, as shown below.
If you give correct format Email address, it will display, as shown below.
Summary
This was the process of how to validate an Email address in Xamarin iOS, using Xamarin Studio.