Swift - Statements with semicolon

Introduction

Swift statements unlike most other programming languages does not end with a semicolon ;

let radius = 3.45
let numOfColumns = 5
let myName = "hi"

If you include semicolons at the end of each statement, it is syntactically correct but not necessary:

let radius = 3.45;
let numOfColumns = 5;
let myName = "hi";

The only time the semicolon is required is when you combine multiple statements into one single line:

let radius = 3.45; let numOfColumns = 5; let myName = "hi";

Related Topic