- Mastering macOS Programming
- Stuart Grimshaw
- 105字
- 2021-07-02 22:54:15
Comments
Swift has adopted C-style comments of both forms:
// We have used this one already
// in previous sections of this chapter
When it starts to get messy, with // at the beginning of each commented line, we have the following multiline comments:
/*
This is a multiline
comment, for those times when
you just can't say it
in a few words
*/
Unlike some languages, you can nest these comments, which is handy if you need to comment out a large section of code that itself contains comments:
/*
Comments can be nested,
/*
like this one
*/
which can be helpful.
*/