Chapter #2: First iOS Application
I assumed you have Xcode installed in your MacOS PC or Laptop. If yes, then its great. We can continue this lecture. Else first you need to install the latest Xcode in your MacOS PC or Laptop.
If you don't know how to install Xcode, then go and check Chapter #1: Welcome to Xcode.
You will find the Xcode icon same as shown in the above image in your Launchpad or Application folder.
Launch this App and you will get first window as shown above. The window presents following options:
- Get started with a playground: This was introduced to the Swift language and Xcode 6. It's an interactive area which can be used to write small pieces of code to check runtime changes. It's a great way for Swift learners to be introduced to new Swift features.
- Create a new Xcode project: Will create a new project with by default configuration.
- Clone an existing project: This is used to check out a project from a repository location, for example, check out a project from SVN.
My First iOS Application
As we are going to create our first iOS application. We will select 'Create a new Xcode project' option and it will ask some initial project setup.
- iOS: Used to create iOS apps, libraries and frameworks.
- watchOS: Used to create watchOS apps, libraries and frameworks.
- tvOS: Used to create tvOS apps, libraries and frameworks.
- macOS: Used to create macOS apps, libraries, frameworks, packages, AppleScripts, etc.
- Cross-platform: Used to create cross-platform apps, templates and In-App Purchase Contents.
This templates are very useful while creating your projects. It has inbuilt framework and libraries to boost up your coding and experience.
On creating of the project, it will provide you the initial class and framework with supporting dependencies.
We will go with 'iOS' template. iOS template provides you to create an Application, Framework and libraries. For now we select 'Single View App' under 'Application' section and click Next button. The below wizard screen will appear.
This wizard screen help you to define the project properties.
- Product Name: The name of the project / application
- Team: The authenticated apple enrolled developer team
- Organization Name: The name of the organization in which you are involved
- Organization Identifier: The unique organization identifier which is used in the bundle identifier. It is recommended to follow reverse domain name service notation.
- Bundle Identifier: This field is very important. It is based on your project name and organization identifier, choose wisely. The bundle identifier will be used in the future to install the application on a device and upload the app to iTunes Connect (which is the place we upload apps to be published on the App Store). It’s a unique key to identify your application.
- Language: The programming language which you would like to use. Here you can change Objective-C to Swift if it’s not selected.
- Use Core Data: If you would like to use Core Data Model in your project then mark it as selected, and it will create a file for the .xcdatamodel. You can also add this file later on if you don't know in advance.
- Include Unit Tests: This configures the unit test target and creates classes for unit testing
- Include UI test: This configures the UI test target and creates classes for UI testing.
Click on Next and it will ask you for a location where you want to create the project directory.
Click on Create and you will see the Xcode UI with an already defined project setup. You can see some classes and Storyboard files as shown below.
Here we have our First iOS Application.
At top left of this window, you will find 'iPhone 11 pro Max' simulator is selected and then click on Run button (look likes play icon).
Simulator is a application provides you to simulate the real iPhone device for you. It will help you to simulate the actual real iPhone device. You can simulate orientations, location, shake gesture, memory warnings, In-Call Status bar, finger touch, lock, reboot, home etc.
Simulator will take sometime to boot and launch your applications. Your First iOS Application will launch and you will see a plain white application because we have not made any changes to the template yet.
Comments
Post a Comment