Documentation Archive

Developer

Markup Formatting Reference

On This Page

Link Reference

Add a named reference to a URL that can be used in multiple places.

Works with:

  • ✓ Playgrounds

  • ✓ Symbol documentation

Syntax

  • [text to display]: URL   "hover title"

The Link Reference statement sets the specified text as a reference to the specified URL with the specified hover title. The Link Reference statement is not appear in the rendered playground or in Quick Help.

  • Text to display is the text to display in the comment.

  • URL is the address to open when the link in the comment is clicked.

  • Hover title (optional) is the text displayed in a playground when the pointer is hovering over the image. It is also used for accessibility.

Playground Example

  1. /*: Setup and use a link reference.
  2.  [The Swift Programming Language]: http://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ "Some hover text"
  3.  For light reading we suggest [The Swift Programming Language].
  4.  For more information, see [The Swift Programming Language].
  5.  If you are not sure, please see [The Swift Programming Language].
  6. */
image: ../Art/MFR_link_reference_2x.png

Quick Help Example

  1. /**
  2.  An example of using a *link reference*
  3.  [The Swift Programming Language]: http://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ "Some hover text"
  4.  For light summer reading we suggest [The Swift Programming Language].
  5.  ### Useful books
  6.  * [The Swift Programming Language]
  7. */
image: ../Art/MFR_symbol_link_reference_2x.png