Transcript
CodeWithChris Swift 4 Syntax Cheat Sheet
Source: http://codewithchris.com/swift-cheat-sheet/ v1.0
var myVariable:DataTypelet myConstant:DataType
Variables/Constants
class myClass:Superclass {}
Classes
StringIntBoolDoubleFloatCharacter
Data Types
func myFunction(arg param:DataType) -> ReturnType {}
Functions
if condition {}else if condition {}else {}
If Statements
for variable in lower...upper {}
while condition {}
repeat {} while condition
Loops
switch value to consider {case value:case value:default:}
Switch