Create an app - basics

Starting:
File -> New -> Project
Or
Create a new Xcode project

Note: single view, only one screen set up

Product name: Give it a name
Team: choose developer id
Organisation identifier: com.yellowbuttonapps
Bundle identifier: must be unique
Click next and choose place to store project in
Click 'create'

Files:
AppDelegate.swift: How your app communicates with IOS.
ViewController: holds the main code
Main.storyboard: contains the GUI elements.
Assets.xcassets: Holds images, icons, launch screens
Launchscreen.storyboard
info.plist

Running your app
Select the simulator from the top left corner.
Hit the play button
To stop it from running, click on the stop button.


Note
- Constraints - ensuring that UI looks the same on different devices

Adding code to the GUI
1. Go to ViewController.swift
2. Go to the viewDidLoad() function
3. Add code below super.viewDidLoad()


Notes:
- To see which class the storyboard is linked to, click on the storyboard, ViewController. Then, click on the identity inspector (which is next to the attributes inspector). Look at class - it will tell you which class contains its codes.
- The ViewController inherits UIViewController.
- viewDidLoad() is where you add the setup code for the UI, like the background.


  1. Click on Main.storyboard
  2. Click on View Controller Scene - View Controller - View'
  3. Click on the screen
To edit the details of the view:
  1. Click on attributes inspect (as shown below)
  2. You can edit the background and other details here.



Note
The storyboard shows you how the app flows from screen to screen.

Give your app a title.
1. Select the title bar at the top of your storyboard. It sits at where the battery is showing.
2. You can assign a title where the attributes inspector is.





Comments

Popular posts from this blog

Setting up a playground

Go to another page