You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comments in Swift are very similar to comments in C. Single-line comments begin with two forward-slashes (//):
// This is a comment.
Multiline comments start with a forward-slash followed by an asterisk (/) and end with an asterisk followed by a forward-slash (/):
/* This is also a comment
but is written over multiple lines. */
Unlike multiline comments in C, multiline comments in Swift can be nested inside other multiline comments. You write nested comments by starting a multiline comment block and then starting a second multiline comment within the first block. > The second block is then closed, followed by the first block:
/* This is the start of the first multiline comment.
/* This is the second, nested multiline comment. */
This is the end of the first multiline comment. */
Nested multiline comments enable you to comment out large blocks of code quickly and easily, even if the code already > contains multiline comments.
Swift also has a concept of documentation comments which begin with three slashes ///, but that's more of an editor concept (Xcode renders them differently) since they're already normal comments by starting with //. Just in case that makes a difference for the parser.
This looks like a very cool tool! Congrats!
Would love to give it a ride with Swift.
Reference
The file extension of Swift source files is
.swift
.The text was updated successfully, but these errors were encountered: