How to add new line to Swift comment for `Quick Help`

Viewed 379

I'm adding comments to a class that is shown via 'Quick Help'. I want the descriptions on different lines, how can I do that?

/// Description of class Foo - line 1
/// line 2
/// line 3
/// line 4
class Foo {
    
}

What is shown in Quick Help:

enter image description here

1 Answers

For multiline comments, use the /** */ markers instead. Check out the Markup Formatting Reference for more details.

Note that for Summary, you can only have 1 line. Every additional line is moved to the Discussion section.

/**
 Description of class Foo - line 1
 
 line 2
 
 line 3
 
 line 4
 */
class Foo {
    
}

Each line renders as a new line in the Quick Help section

Related