Tsallaka zuwa abun ciki
Justice Tech School

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.

 note

Quiz Test

Which marks a doc comment?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.