Skip to content

Latest commit

 

History

History
131 lines (83 loc) · 4.73 KB

File metadata and controls

131 lines (83 loc) · 4.73 KB

THEO Knowledge Base - Simple Application

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.

Table of Contents

Create New Project

Open Xcode and click on Create a new Xcode project

"Create Project"

Xcode provides various project templates for different platform. Select Single View App template for iOS and click Next.

"Single View App"

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 form Bundle 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.

"Set Project Info"

Click on the Team dropdown box and select the Apple User previously signed in. Then click Next.

"Set Project User"

Save project to desire location. Note that, Xcode use Git for source control by default.

"Save Project"

Xcode IDE will be started on project creation succeeded.

"New Project Created"

An error prompt will be prompted if author information is not previously configured in Xcode. Click Fix...

"No Author Warning"

Provide Author Name and Author Email. These info will be used when commit changes to the Git repo using Xcode.

"Input Author Info"

Implementation

Click on Main.storyboard which will bring up interface builder.

"Open Main Storyboard"

Click the + button on the top left to access element library

"Create Label"

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.

"Position Label"

Select Horizontally in Container and Vertically in Container then click Add 2 Constraints to keep the label in the center of the view controller.

"Create Constraints For Label"

Click on the label in the view controller and access Attributes Inspector on the left.

"Highlight Label"

Change the word Label to Hello World in the attribute inspector and press enter to apply the changes.

"Change Label To Hello World"

Build Project

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.

"Build Project"

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.

"Project Build Failure"

Build result will also be reported in the popup:

"Build Result Popup"

Summary

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.