Comments
Use annotations to inject executable text into your own code as your own notes or hints. Comments are ignored when the Swift compiler runs.
Swift's comments are very similar to the C language, with Single-line comments beginning with two backslashes:
This is a line of comments
Multiline comment begins with///ends with/*:
<span style= "color: #008000;" >/* This is also a note,
but across multiple lines * *
</span>
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/extra/
Unlike multiline comments in C, Swift's multiline annotations can be nested within other multiline annotations. The writing is to insert another multiline comment within a multiline comment block. When the second comment block is closed, the first comment block is still followed:
/* This is the beginning of the first multiline comment
/* This is the second multiline comment that is nested * *
This is the end of the first multiline comment.
Multiple-line annotation nesting is a quick and easy Comment code block, even if there is already a comment in the code block.
Semicolon
Unlike other languages, Swift does not require semicolons to be used at the end of each line of statements (;), but when you write multiple statements on the same line, you must separate them with semicolons:
1 Let cat = "Meow"; println (CAT)
2
3//Output "Meow"
Author: cnblogs Joe.huang