4

Given an enum that has a case with parameters, how can I document these parameters?

For example these code comments:

/// Various coffee types.
enum Coffee {

  /// A Cappuccino.
  /// - parameters:
  ///   - cream: Is true if cream is added.
  case cappuccino(cream: Bool)
}

produce this pop-up which is lacking the cream parameter documentation.

enter image description here

So what is the correct markup?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Manuel
  • 14,274
  • 6
  • 57
  • 130

1 Answers1

5
/// Various coffee types.
enum Coffee {

    /// A Cappuccino.
    /// - cream: Is true if cream is added.
    case cappuccino(cream: Bool)
}

It'll show up as a bullet point when you click on cappuccino but won't show up if you click on the cream parameter.. But it's good enough I guess..

Brandon
  • 22,723
  • 11
  • 93
  • 186