Subscripts

Set subscript(index: Int) in the class to index the data of the instance of the this class.

April 10, 2022

Closures

The closures can cantains something by the curly bracket.

April 2, 2022

Function

Call the function(method) to do something detail.

April 2, 2022

Control Flow

loop, condition branch, control transfer.

March 28, 2022

Collection Type

The array, set, and dictionary.

March 28, 2022

Strings and Characters

String type is bridged with Foundation’s NSString. Foundation extends String to expose methods defines by NSString. If import Foundation, you can access those NSString methods on String without casting. String Literals // "Hello World!" is a String literal. let sentence = "Hello World!" // Multiline let story = """ There are some people in the room. They are having a party. Because today is the Christmas. """ // every line has the line breaks. // the start and end sign(""") must take a single line. // backlash(\), it means that the string is not broken. Then line breaks not to be part of the string's value. let content = """ In a happy atmos\ phere. We start the conversation """ print(content) // result: In a happy atmosphere. We start the conversation. // Alignment of quotation marks in the multiline string. let desc = """ Ha it's so funny. """ print(desc) // result: Ha its so funny. let desc = """ Ha it's so funny. """ print(desc) // result: Ha its so funny. let desc = """ Ha it's so funny. """ print(desc) // result: Ha its so funny. Special Character in String Literals ...

March 20, 2022

Basic Operators

Basic usage of the operators.

March 19, 2022

Basic

Basic usage of the swift syntax.

March 12, 2022