Guides and Sample Code

Developer

Markup Formatting Reference

On This Page

Precondition

Adds a Precondition callout to the Quick Help for a symbol. Multiple Precondition callouts appear in the description section in the same order as they do in the markup.

Use the callout to document any conditions that are held for the documented symbol to work.

Works with:

  •     Playgrounds

  • ✓ Symbol documentation

Syntax

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

The description displayed in Quick Help for the precondition callout is created as described in Parameters Section.

Example

  1. /**
  2.  An example of using the precondition field
  3.  - Precondition: The `person` property must be non-nil.
  4.  - Precondition: `updatedAddress` must be a valid address.
  5. */
image: ../Art/MFR_symbol_field_precondition_2x.png