Skip to main content

Swift Programming Basics - Variables - Part 2

·65 words·1 min· loading · loading ·
Author
Peter Entwistle
Senior iOS Developer, with a passion for technology and gardening. Trying to push the boundaries of what can be grown in the UK.

In this second video I show you how variables work in Swift.

Video
#

Code
#

Variables.swift
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
println("Hello World!")

var name: String

name = "Peter"

var x = 20
var y: Float = 5.2

var isEnabled: Bool = false

Float(x) + y

x = 8

View on GitHub

Download the code