Skip to content

Instantly share code, notes, and snippets.

@fakefish
Last active August 29, 2015 14:02
Show Gist options
  • Save fakefish/7d93bea637783fa95741 to your computer and use it in GitHub Desktop.
Save fakefish/7d93bea637783fa95741 to your computer and use it in GitHub Desktop.
some code of swift
var myVariable = 42
let myVariable = 42
let explicitDouble: Double = 70
let lable = "The width is "
let width = 94
let widthLable = label + String(width)
let apples = 3
let oranges = 5
let appleSummary = "I have \(apples) apples."
let fruitSummary = "I have \(apples + oranges) pieces of fruit."
var shoppingList = ["catfish", "water", "tulips", "blue paint"]
shppingList[1] = "bottle of water"
var occupations = [
"Malcolm": "Captain",
"Kaylee": "Mechanic",
]
occupations["Jayne"] = "Public Relations"
let emptyArray = String[]()
let emptyDictionary = Dictionary<String, Float>()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment