Headings
Display a line of text formatted as a heading.
Works with:
✓ Playgrounds
✓ Symbol documentation
Syntax
Use number signs (#
) to specify up to three levels of heading. There is at least one space between the number sign and the title string.
# Heading 1 String
## Heading 2 String
### Heading 3 String
Alternatively, create level 1 and level 2 headings with an underline string.
Heading 1 String
=…
Underline heading 1 text with at least one equals sign (=
).
Heading 2 String
-…
Underline heading 2 text with at least one equals sign (–
).
Example 1
Create a heading using a number sign.
Playground Markup
//: ## Level 2 Heading Using Number Signs (`#`)
Quick Help Markup
/**
An example of using a number sign (`#`) for a *heading*
## This is a Heading 2
*/
Example 2
Create a heading using the equals sign for level 1, or the hyphen for sign for level 2. This example uses the same number of equal signs the number of characters in the heading string. Only one equals sign is required.
Playground Markup
//: Level 1 Heading Using Equals Sign ('=')
//: =
Quick Help Markup
/**
An example of using a character underline for a *heading*
This is a Heading 1
===================
*/
Copyright © 2018 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2017-06-05