1, optional type.
1. Escape special characters (null character), \ \ (backslash), \ t (horizontal tab), \ n (newline character), \ r (carriage return), \ "(double quotation mark), \ ' (single quotation mark).
2. Single-byte Unicode scalar, written as \xnn, where nn is a two-bit hexadecimal number.
3. Double-byte Unicode scalar, written as \unnnn, where nnnn is a four-bit hexadecimal number.
4. Four-byte Unicode scalar, written as \unnnnnnnn, where nnnnnnnn is a eight-bit hexadecimal number.
5 . Note: The struct is passed in the code in the way it is copied, so do not use reference counting.
Struct instances are always passed by value, and class instances are always passed by reference.
Computed properties can be used in classes, structs, and enumerations, and stored properties are used only for classes and struct bodies.
Classes that belong to reference types are different, and when you assign an instance of a reference type to a constant, you can still fix the |
The variable property of the instance is changed. |
6.
Because a class is a reference type, there may be multiple constants and variables that reference a class instance at the same time in the background. (This is not true for structs and enumerations.) Because they are value types, they are assigned to constants, variables, or passed to functions |
, they are always copied. ) |
|
7.
In addition to storing properties, classes, structs, and enumerations can define computed properties, and computed properties do not store values directly, but instead provide a |
Getter to get a value, an optional setter to indirectly set the value of another property or variable. |
Swift Small note