Zhao yazhi _ Swift (3) _ swift annotation and Zhao yazhi _ swift Annotation

Source: Internet
Author: User

Zhao yazhi _ Swift (3) _ swift annotation and Zhao yazhi _ swift Annotation

Note the non-execution text in your code into prompts or notes for future reading. The Swift compiler automatically ignores the comments when compiling the code.

Single line comment

Start with a double Forward slash:

// This is a comment

Multi-line comment

It starts with a single forward slash followed by an asterisk (/*), ends with an asterisk followed by a single forward slash (*/):

/* This is a multi-line comment */

Multiline comment Block

Swift multiline comments can be nested in other multiline comments. You can create a multi-line comment block, and then nest it into a second multi-line comment block. When terminating a comment, insert the ending mark of the second comment block, and then insert the ending mark of the first comment block:

/* This is the beginning of the first multi-line comment/* this is the second nested multi-line comment */This is the end of the first multi-line comment */

By using nested multi-line comments, you can quickly and easily comment out a large piece of code, even if the Code already contains multi-line comments.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.