Subscripts
Set subscript(index: Int) in the class to index the data of the instance of the this class.
Set subscript(index: Int) in the class to index the data of the instance of the this class.
The closures can cantains something by the curly bracket.
Call the function(method) to do something detail.
loop, condition branch, control transfer.
The array, set, and dictionary.
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 ...
Basic usage of the operators.
Basic usage of the swift syntax.