Note
Inject unexecutable text into your code through annotations as your own notes or tips. Notes are ignored when the Swift compiler is running.
Swift comments are very similar to C. A single line comment starts with two backslashes:
// This is a line of comment
Multi-line comments start with/* and end:
/* This is also a comment, but it spans multiple rows */
Different from multi-line comments in C, Swift multi-line comments can be nested in other multi-line comments. Insert another multi-line comment in a multi-line comment block. When the second comment block is closed, the first comment block is followed:
/* This is the beginning of the first multi-line comment/* this is the second multi-line comment nested */This is the end of the first multi-line comment */
Nesting of multi-line comments is a code block that you can more quickly and conveniently comment, even if the code block already contains comments.
Semicolon
Unlike other languages, Swift does not require a semicolon (;) at the end of each line of statements. However, when you write multiple statements in the same line, they must be separated by semicolons:
1 let cat = "meow"; println (CAT) 2 3 // output "meow"
Thank you, Swifter-QQ group: 362232993 ~
Fork: https://github.com/Joejo/Swift-lesson-for-chinese