> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Swift Documentation Comment

Swift documentation comments are specialized annotations parsed by the Swift compiler and documentation generators (such as Xcode's Quick Help and Swift DocC) to produce rich, structured API reference material. They utilize a custom dialect of Markdown to format text, define symbol contracts, and establish cross-references.

## Syntax Variants

Swift supports two distinct delimiters for documentation comments:

**Single-line delimiters** use three forward slashes (`///`). This is the preferred convention in the Swift ecosystem for both single and multi-line documentation.

```swift theme={"dark"}
/// This is a single-line documentation comment.
```

**Block delimiters** use a slash followed by two asterisks (`/**`) to open, and an asterisk followed by a slash (`*/`) to close.

```swift theme={"dark"}
/**
 This is a block documentation comment.
 It spans multiple lines.
 */
```

## Structural Parsing

The Swift compiler implicitly divides documentation comments into three semantic sections based on line breaks:

1. **Summary:** The first paragraph. It is parsed as a concise, high-level description of the symbol.
2. **Discussion:** Any subsequent paragraphs separated from the summary by a blank line. This section supports standard Markdown elements like headings, lists, and code blocks.
3. **Callouts/Fields:** A structured list of keywords defining the symbol's inputs, outputs, and error states.

## Standard Callout Fields

Swift recognizes specific Markdown list items to populate dedicated UI fields in Quick Help and generated documentation.

* **`- Parameter [name]:`** Documents a single parameter.
* **`- Parameters:`** Documents multiple parameters using a nested list.
* **`- Returns:`** Documents the return value.
* **`- Throws:`** Documents the error types the function can throw.

```swift theme={"dark"}
/// Calculates the quotient of two integers.
///
/// This function performs standard integer division. If the denominator
/// is zero, the function will throw a `MathError`.
///
/// - Parameters:
///   - dividend: The number to be divided.
///   - divisor: The number by which to divide the dividend.
///
/// - Returns: The integer result of the division.
///
/// - Throws: `MathError.divisionByZero` if `divisor` is `0`.
func divide(_ dividend: Int, by divisor: Int) throws -> Int {
    // ...
}
```

## Markdown Formatting and Symbol Linking

Documentation comments support standard Markdown formatting, including emphasis (`*italic*`, `**bold**`) and inline code (` `code` `).

Additionally, Swift DocC utilizes **Symbol Linking**. Enclosing a Swift symbol name in double backticks instructs the documentation compiler to resolve the symbol and generate an active hyperlink to that symbol's documentation page.

```swift theme={"dark"}
/// Initializes a new ``NetworkRequest`` instance.
///
/// Use this initializer before calling ``execute(with:)``.
```

## Custom Callouts

Beyond standard API fields, Swift supports arbitrary callouts using the `- [Keyword]:` syntax. The documentation compiler recognizes several standard keywords to render distinct visual styling (e.g., badges or colored blocks). Common recognized callouts include:

* `- Note:`
* `- Warning:`
* `- Important:`
* `- Experiment:`

```swift theme={"dark"}
/// - Warning: This method is not thread-safe.
/// - Note: For concurrent execution, use ``asyncExecute()``.
```

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor Swift Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
