String Interpolation in Swift is a method for constructing new String values by embedding expressions…
Swift Operators Basics

Learn about Swift Operators. These essential symbols perform various operations on values and variables, and we’re going to explore them with easy-to-understand examples.
Assignment Operator = in Swift
The assignment operator = is used to assign a value to a variable or constant.
var score = 10
let constantScore = score
Arithmetic Operators
Addition +
Used to add two values.
let sum = 5 + 3 // sum equals 8
Subtraction –
Used to subtract one value from another.
let difference = 5 - 3 // difference equals 2
Multiplication *
Used to multiply two values.
let product = 5 * 3 // product equals 15
Division /
Used to divide one value by another.
let quotient = 6 / 3 // quotient equals 2
Compound Assignment Operators
Compound assignment operators combine assignment =Β with another operation.
Addition Assignment +=
Adds and assigns the result.
var total = 0
total += 5 // total is now 5
Subtraction Assignment -=
Subtracts and assigns the result.
var batteryLife = 100
batteryLife -= 15 // batteryLife is now 85
Multiplication Assignment *=
...π The remaining content of this article is only available on our Substack!