Chapter 2


[vc_row][vc_column][vc_column_text css=”.vc_custom_1487155578961{padding-bottom: 40px !important;}”]

Setting an iOS Project

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_tta_tour][vc_tta_section title=”page1″ tab_id=”1549348430101-97eacb87-729a”][vc_column_text]Lets begin setting an iOS Project by taking some practical scenarios. For developing the iOS application we need Xcode, which you can get from Apple App Store free of cost. First of all, open Xcode go to File -> New -> Project as shown below

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Page 2″ tab_id=”1549348430123-c01f35aa-4273″][vc_column_text]When you select the Project option, Xcode will display the iOS project templates as shown below.

As you can see there are options for iOS as well as for Mac OS X. As we are interested in iOS Apps Development, under iOS we will select Application. Under Application there are 5 templates. We will select the most basic one “Single View Application”. As iOS is UI driven app development there should be at least one view. Thus we opt for this template. When you click next, you will see a form having following fields:
Product Name: Name of the project
Organization Name: Name of the Company
Company Identifier: It is a package name of the company, which is producing the project. Normally we use reverse domain name as com.organizationname”.
You can use upper case and lower case but they are case sensitive, but using lower case is advised.
Bundle Identifier: It is combination of company identifier dot product name (companyidentifier.productname). This is unique to the application. It is changeable during deployment process.[/vc_column_text][/vc_tta_section][vc_tta_section title=”Page 3″ tab_id=”1549348469960-dad9f1cf-6e40″][vc_column_text]We will see its importance when we deploy the app on the device and on the App Store. It is uneditable at this stage.
Language: Now with Swift been introduced. You have an option whether you can use Swift or Objective C to create the project. One can have few classes with Swift and few with Objective C.
It is drop down with two options – Swift and Objective C
Devices: It is a drop down list having three options – iPhone, iPad and Universal. We will start with iPhone first. Depending upon your requirement you can choose either one of them.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Page 4″ tab_id=”1549348514489-2fcd3f61-de4f”][vc_column_text]

We have field the form as shown below

Product Name: Project1 (Always start the project name with uppercase)

Organization Name: Nimap Infotech

Company Identifier: com.nimapinfotech

Bundle Identifier: com.nimapinfotech.Project1 (auto generated)

Language: Swift

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Page 5″ tab_id=”1549348545553-8228262f-e328″][vc_column_text]

Devices: iPhone

uncheck the Core Data check box once you click next, the file browser will be shown.

As shown below, you select the location on your hard drive where you want to create the project.

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Page 6″ tab_id=”1549349048650-b6f84333-dc95″][vc_column_text]

Once you select the location, press create button, the project gets created on the selected location and Xcode opens up the project as shown below. We will first look at the Xcode IDE and see what iOS templates have been provided.                                                                                                          I always believe in learning with observations.

On the top right of the tool bar, you will find three boxes as shown .


Click on them to see what happens!(don’t worry). You have to click the right 3 boxes, which have blue and gray bars. When you play with these boxes you realise that Xcode is divided into 4 major windows namely, Left Window or Navigation Pan: This window shows all the files, which are used in the project. Also it is further divided into 8 tabs each having its own unique[/vc_column_text][/vc_tta_section][vc_tta_section title=”Page 7″ tab_id=”1549349099449-5ede4868-1676″][vc_column_text]

functionality. We mostly use the first tab, which shows all the files of the project, which help us to navigate between them. Single View Application template has created two Swift classes – an AppDelegate class and a ViewController class along with Main story board file. It also has creates one image assets folder.

 Right Pan or Tool or Help Window: This window is used to give us quick help.

Secondly, this window is used with some Xcode tools like Story Board and Interface Builder. We will see this window more in detail when we learn these tools. The right window as show, has two tabs. The first tab gives us file information, which is active on Xcode. The second tab, which when highlighted, gives us Quick Help of the text selected in the Editor.

The Right window is divided into 2 windows upper window and bottom window. Upper window we have already discussed. The bottom window has 4 tabs which are used with the tools. They have the Object Library and the Code library where you can just drag and drop things to the editor.


[/vc_column_text][/vc_tta_section][vc_tta_section title=”Page 8″ tab_id=”1549349106536-3624fcb4-5af6″][vc_column_text]

This section is mostly used with the storyboard and interface builder tools. Bottom Window or Console Window or Debugger Window: This window is divided into two halves. On the left is the debugger window with all debugging options like step up, step down and so on. On the Right window is the consolewindow where the console logs are printed.

Center Window or Editor Window: This window is the editor window where you will be writing the code for the selected project. When the project is created, the editor window appears showing the default settings

[/vc_column_text][/vc_tta_section][vc_tta_section title=”Page 9″ tab_id=”1549349117076-5ac62e21-fbbb”][vc_column_text]

Suppose you select the AppDelegate.swift file from the Navigation Window than editor window will show AppDelegate.h.

In the next chapter, we will look at the typical life cycle of an iOS Application.



Build Your Team in 1 Hour