• Articles
  • Tutorials
  • Interview Questions

First iOS Application

How to create first iOS App in Xcode?

To create the application in iOS, use the following steps:
Step 1: Open Xcode and choose Create a new Xcode project to start a new project:
i6

Step 2 − Select Single View Application and click “Next”.
i7

Step 3: Fill specified information
i8

  • Product Name: HelloWorld–  It indicate the name of app.
  • Company Identifier: intellipaat–It specifies a domain name. If you don’t have domain name you can use “edu.self”.
  • Class Prefix: HelloWorld– Xcode uses the class prefix to name the class automatically.
  • Device Family: iPhone–  use iPhone
  • Use Automatic Reference Counting: [checked]– By default, this should be enabled. It is chosen to automatically release the resources assigned once it goes beyond scope.

Click next after filing the above information

become an ios developer

Step 4: Choose the directory for the project and choose create.
i9

Step 5: It will show a screen as follows:
i10

Step 6:  Then choose iPhone simulator in the drop down close to Run button and choose run.
i11
Automatically Xcode creates the app and runs it in the Simulator. The simulator looks like as follows:
i12
It shows blank screen because app is incomplete. To end the app presses the Stop button.

Step 7: Choose HelloWorldViewController.xib to complete your app. After choosing the file the editor changes to an interface builder and shows an empty view of app like as follows:
i13

Step 8: Select the UI controls from the right side panel. For this HelloWorld app select Round Rect Button” and drag it into the view. Try to place the button at the center of the view.
i14

Step 9: To alter the label of the button double press it and name it “Hello World” and then run the app again then it looks like as follows:
i15

Step 10: But this button does not perform any action so to perform action use the code. Choose the HelloWorldViewController.h then editor area now shows the source code of the chosen file.  Insert the following line of code before the “@end” line:

-(IBAction)showMessage;

After editing the file at the end it look like as follows:
i16

Step 11:  Then choose the “HelloWordViewController.m” and add the code before the @end like as follows:
i19
After editing it look like as follows:
i20

Step 12: Now set up a link between the HelloWorld button & showMessage action. For this purpose, choose the HelloWorldViewController.xib file to go back to the Interface Builder.
Press and grip the Control and click HelloWorld button & drag to the File’s Owner. Then it will look like as follows:
i21

Step 13: Release both buttons and displays the showMessage action. Choose it to build a link.
i22

Step 14: Then again run the app using simulator. It will display following output:
i23

Course Schedule

Name Date Details
iOS Development Training 14 Dec 2024(Sat-Sun) Weekend Batch View Details
21 Dec 2024(Sat-Sun) Weekend Batch
28 Dec 2024(Sat-Sun) Weekend Batch

About the Author

Technical Research Analyst - Full Stack Development

Kislay is a Technical Research Analyst and Full Stack Developer with expertise in crafting Mobile applications from inception to deployment. Proficient in Android development, IOS development, HTML, CSS, JavaScript, React, Angular, MySQL, and MongoDB, he’s committed to enhancing user experiences through intuitive websites and advanced mobile applications.