Swift Comments
Use // for one line and /* */ for several lines. Documentation comments start with /// and show in Xcode quick help.
Example
// single line
/* multi
line */
/// Adds two numbers.
func add(_ a: Int, _ b: Int) -> Int { a + b }
print(add(1, 2))Exercise
Start a line comment.
noteQuiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.