SWIFT cheat sheet

I’ve added some swift codes which can be helpful for beginners. You can bookmark this page, as it can be used for quick recall.

Declare variables in swift:

Concatenate strings  in swift

Declare arrays in swift

Find number of elements in array in swift

Tuples in swift

Declare Class in swift

Instantiate class in swift

Declare Struct (or structure) in swift

Inherit Class in swift

Declare  simple method / function without argument and return type:

Declare method / function with argument and return type

For loop

For loop in another form

For loop in array

While loop:





Leave a Reply