Reader Level:
ARTICLE

Login Window in iPhone

Posted by Sachin Bhardwaj Articles | iOS November 22, 2012
In this article I will create a login window without using a storyboard.
  • 0
  • 0
  • 2248
Download Files:
 

Introduction

In this article I will create a single-view application. Here I use two text fields, one button and two labels from outlets. In this article I will add an activity indicator which shows after the login button is clicked.

Step 1

Open XCode by double-clicking on it.

xcode-in-iphone.jpg

Step 2

Create a New XCode Project by clicking on it.

create-project-in-iphone.jpg

Step 3

Now select Single View Application and click on Next.

single-view-application-in-iphone.jpg

Step 4

Now provide your Product Name and Company Identifier then click on Next.

project-name-in-iPhone.jpg

Step 5

Select the location where you want to save your project and click on Create.

save-project-location-in-iphone.jpg

Step 6

Here we write the code:

loginviewcontroller.h-in-iPhone.jpg

loginviewcontroller.m-in-iPhone.jpg

Step 7

To hide the keyboard after clicking on the keyboard return button, we link a delegate of the text field to the file owner. 

connect-txtfield-delegate-to-fileowner-in-iPhone.jpg

Step 8

To hide the Activity Indicator from the UI we select the activity indicator and mark it's property to hidden.

hide-activity-indicator-in-iPhone.jpg

Step 9

To secure the password field we select the text field property and set it to Secure.

secure-password-txtfield-in-iPhone.jpg

Step 10

At last we run our application and see the output.

Output

Output 1 in iPhone:

output1-in-iPhone.jpg

Output 2 in iPhone:

output2-in-iPhone.jpg

COMMENT USING

Trending up