Home » Swift Assignment Operator

Swift Assignment Operator

by Online Tutorials Library

Assignment Operator

Assignment operator is used to initialize or update the values of both its operands. For example, here (a = b), the assignment operator (=) initializes or updates the value of a with the value of b.

If the right side operand contains the multiple values, its elements can be decomposed into multiple constants or variables at once:

Swift 4 assignment operator does not itself return a value like C and Objective C assignment operators do.

So, the following statement is invalid in Swift 4:

You may also like