2

I have the following doc comment in Swift:

/**
- Trace
- ↓
- Debug
- ↓
- Information
- ↓
- Warning
- ↓
- Error
*/

The line that says "Warning" does not render in Xcode because "- warning" is a keyword callout in swift doc comments. How can I escape the callout?

S Coder
  • 31
  • 4

2 Answers2

0

Not a perfect solution, but you could surround Warning with backticks (`). This will change its display style slightly:

/**
 - Trace
 - ↓
 - Debug
 - ↓
 - Information
 - ↓
 - `Warning`
 - ↓
 - Error
 */

Comments

JAL
  • 41,701
  • 23
  • 172
  • 300
0

You can use a zero-width space (​) before the keyword:

/**
 - Trace
 - ↓
 - Debug
 - ↓
 - Information
 - ↓
 - ​Warning
 - ↓
 - Error
 */

screenshot of rendered documentation

Lauren Yim
  • 12,700
  • 2
  • 32
  • 59