This guide is going to show how to create a simple iOS application.
Checkout THEO Knowledge Base - Xcode Setup for guide on how to setup Xcode.
Open Xcode and click on Create a new Xcode project
Xcode provides various project templates for different platform. Select Single View App
template for iOS and click Next
.
Fill in the options as follows:
- Product Name:
helloworld
- Organization Name: Name of your organization
- Organization Identifier: This is in reversed domain name notation and will be concatenated with
Product Name
to formBundle ID
. The identifier is not connected to any domain but is used to uniquely identify app. - Language: All THEOplayer Reference Apps are written in Swift
- User Interface: All THEOplayer Reference Apps are developed based on Storyboard/UIKit.
- Use Core Data: Uncheck unless it is needed.
- Include Unit Tests: Uncheck unless it is needed.
- Include UI Tests: Uncheck unless it is needed.
Click on the Team
dropdown box and select the Apple User previously signed in. Then click Next
.
Save project to desire location. Note that, Xcode use Git for source control by default.
Xcode IDE will be started on project creation succeeded.
An error prompt will be prompted if author information is not previously configured in Xcode. Click Fix...
Provide Author Name
and Author Email
. These info will be used when commit changes to the Git repo using Xcode.
Click on Main.storyboard
which will bring up interface builder.
Click the + button on the top left to access element library
Search for Label
then drag and drop it the view controller. Then click on the Align
at the bottom of the interface builder to bring up the Alignment Constraints
popup.
Select Horizontally in Container
and Vertically in Container
then click Add 2 Constraints
to keep the label in the center of the view controller.
Click on the label
in the view controller and access Attributes Inspector
on the left.
Change the word Label
to Hello World
in the attribute inspector and press enter to apply the changes.
From Xcode menu bar, click Product > Build
or ⌘ + B
to build the project. Progress of the build can be inspected in the progress bar at the top of Xcode.
In case of failure or warning, click on the icon in Xcode progress bar or the triangular warning button to navigate to the Issue Navigator
. Address the issue and rebuild.
Build result will also be reported in the popup:
A simple iOS application has been created successfully. The next guide will cover how to launch the simple application on simulator and actual iOS device THEO Knowledge Base - Simulator And iOS Device.
For more guides about THEOplayer please visit THEO Docs portal.