Skip to main content

Hello World Java project using Eclipse IDE


Tools needed :

XCode (I am going to use Version 10.1 to build the following app)

Please click on the images to see an enlarged version.

Steps:

Launch XCode.
Before creating our application, we should make sure to add a personal team with our apple account in XCode. If we skip this, we will get an error while running our app in a simulated device.
To add our account, follow the below steps.
Click XCode from the menu bar and select Preferences


In the Preferences window, click on the Accounts tab.



Click the + icon on the bottom left corner to add your apple ID by selecting "Apple ID" and clicking Continue.



Enter your Apple ID, password and click Next. Apple Account will be added to XCode as your personal team.



 Now we are all set to start building out first IOS application. Unlike other IDEs, XCode lets us drag and drop components and generates respective code for us.
Select Create a new XCode project



Select Single View app, this is where we select project type based on which a project skeleton will be created by XCode. Our HelloWorld app just has a single screen, so we are selecting Single View App


Enter the Product Name, select Team as your personal team which we created in the previous steps.
Fill in other details and select language as “Swift”. We use swift to develop our app. We can also use objective C, but I prefer using Swift as it is easy to learn and requires less code.


Select a folder to save your project and click Create. I have created a folder named “Apps” in my desktop and selected it to save HelloWorld app.


 In the project explorer window, click Main.storyboard, this will be our View where we will drag and drop UI objects. Once the view appears, click on the object’s icon on the top right. See below snapshot, I have marked the icon red to highlight it. (Icon looks like a circle with a square inside it).


 In the search window, enter Label (it will show the results as soon as you type something). In our example Label is displayed in the result window when I typed “la” LOL.


Drag the label (see highlighted component in the below snapshot) and drop it in the View. Once the label appears, click on the object attributes icon, this will show all the attributes associated with a label.



 In the attributes window, clear the Label text and enter “Hello World”  and click enter. Hello World appears on the screen as shown below.
  


Now we must add constraints to make sure the label is always visible in the View. To do this, Click the constraints icon(highlighted in red, see below image), click all four sides and once you have selected all four, it will look like the below image with all four side lines changed to Redline. Click “Add 4 Constraints” button to add them to the view.
  


Now we are done with our UI development, let us go ahead and run our first IOS App.
Click on the Run icon (see top left corner for the play icon). This will build our project and run it on a simulator. I am using iPhone 7 to run my application.






Congratulations, you have successfully created your first Hello World IOS application.

Any doubts or challenges please feel free to comment.


Comments

Popular posts from this blog

Basic Programs using Java

I have shared some of the basic programs written in Java. Please see below and practice them with eclipse or any IDE. If you prefer to run it in a separate JVM you can do that as well. Here I have shared the samples written using eclipse. Please click on the images to see an enlarged version. 1. Fibonacci Series package com.techietamizhan.basicprograms; public class FibonacciSeries {                         public static void main(String[] args) {                         getFibonacciSeries(10);             }             public static void getFibonacciSeries(int count) {          ...

Hello World IOS App using XCode and Swift

Tools needed : XCode (I am going to use Version 10.1 to build the following app) Please click on the images to see an enlarged version. Steps: Launch XCode. Before creating our application, we should make sure to add a personal team with our apple account in XCode. If we skip this, we will get error while running our app in a simulated device. To add our account, follow the below steps. Click XCode from the menu bar and select Preferences In the Preferences window, click on Accounts tab. Click the + icon on the bottom left corner to add your apple ID by selecting "Apple ID" and clicking Continue. Enter your Apple ID, password and click Next. Apple Account will be added to XCode as your personal team.   Now we are all set to start building out first IOS application. Unlike other IDEs, XCode lets us drag and drop components and generates respective code for us. Select Create a new XCode project Sele...