Documentation Archive

Developer

Markup Formatting Reference

On This Page

Example

Add an Example callout to a playground using the Example delimiter.

Works with:

  • ✓ Playgrounds

  •    Symbol documentation

Syntax

  • * | + | - Example: description
  • optional continuation of description

Example

  1. /*:
  2.  - Example: *A simple `for` loop.*\
  3.  This example shows a `for` loop that prints the numbers 1 to 5.\
  4. \
  5.  `for index in 1...5 {`\
  6.  `   print("index = \(index)")`\
  7.  `}`}
  8. */
image: Art/MFR_example_2x.png