Zhao Yazhi _swift (3) _swift Comment

Source: Internet
Author: User

Comment The non-executable text in your code into hints or notes to make it easier for you to read in the future. The Swift compiler will automatically ignore the comment section when compiling the code.

Single-line Comment

Double forward slash (//) as the starting tag:


Multi-line comments

The start tag is followed by an asterisk (/*) after a single forward slash, and the Terminator is marked with an asterisk followed by a single forward slash (*/):


Multi-line comment block

Swift's multiline comments can be nested within other multiline annotations. You can make a multi-line comment block, and then nest the second multiline comment in the comment block. When terminating a comment, insert the terminating tag of the second comment block, and then insert the terminating tag of the first comment block:


By using nested multiline annotations, you can quickly and easily comment out a large chunk of code, even though the code already contains multiple lines of comment blocks.

Zhao Yazhi _swift (3) _swift Comment

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.