Create your first program in Swift 3

suggest change

Here I am presenting how to create first basic program in Swift 3 language. First you need to have any basic programming language knowledge or not having then be ready to learn it from beginning.

Requirements for developments:

  1. MAC OS - Version 10.11.6 or later for new Xcode 8.2
  2. Xcode - Version 8.2 Apple Document for Xcode introduction.

Xcode 8.2 has new Swift 3 language features with new iOS 10 compatible APi’s.

Create your first program

First go to Application and open your Xcode 8.2.

After that you will see the screen

Then choose Create new Project and after that you will see next screen

This is also very important part inside Xcode for selecting our project type. We need to choose our project according to types of OS. There are five types of options available on the top side:

  1. iOS
  2. watchOS
  3. macOS
  4. Cross-platform

Now we are choosing iOS platform for development and creating very basic project with the single view application option:

Then we need to give Product Name, this will represent your Bundle name and application name.

Application name you can change later as per your requirements. Then we need to click “Create” and after that your screen will look like this one below:

Inside this class you can see the file name is ViewController.swift and inside the class the name is also ViewController which is inheritance by the UIViewController super class and finally we’re creating our first variable which name is myString of the type ‘String’. Add the following under ‘super.viewDidLoad()’

let myString = "Hello, World!"

We are going to print the content of this variable. First, select your simulator type at the top left hand side of the screen and then click on the “Run” button.

After that your output will be shown on terminal which is on bottom right hand side. Congratulations, This is your first Hello World program inside Xcode.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Getting started with iOS:
* Create your first program in Swift 3

Table Of Contents
0 Getting started with iOS
12 UIView
15 UIColor
26 UIImage
28 CALayer
30 NSDate
40 iBeacon
49 NSTimer
79 NSURL
87 AWS SDK
96 NSData
101 Segues
104 EventKit
105 NSBundle
106 SiriKit
111 StoreKit
117 3D Touch
119 Keychain
122 Block
141 AirDrop
144 UISlider
145 Carthage
146 HealthKit
151 plist
157 MVVM
164 UIPhoenix
166 Simulator
168 NSArray
169 OpenGL
175 Core Data
179 MyLayout
180 UIFont
189 Security
200 Codable