---
title: Debugging and Reflection
framework: swift
role: collectionGroup
role_heading: API Collection
path: swift/debugging-and-reflection
---

# Debugging and Reflection

Fortify your code with runtime checks, and examine your values’ runtime representation.

## Topics

### Printing and Dumping

- [print(_:separator:terminator:)](swift/print(_:separator:terminator:).md)
- [print(_:separator:terminator:to:)](swift/print(_:separator:terminator:to:).md)
- [debugPrint(_:separator:terminator:)](swift/debugprint(_:separator:terminator:).md)
- [debugPrint(_:separator:terminator:to:)](swift/debugprint(_:separator:terminator:to:).md)
- [dump(_:name:indent:maxDepth:maxItems:)](swift/dump(_:name:indent:maxdepth:maxitems:).md)
- [dump(_:to:name:indent:maxDepth:maxItems:)](swift/dump(_:to:name:indent:maxdepth:maxitems:).md)

### Testing

- [assert(_:_:file:line:)](swift/assert(_:_:file:line:).md)
- [assertionFailure(_:file:line:)](swift/assertionfailure(_:file:line:).md)
- [precondition(_:_:file:line:)](swift/precondition(_:_:file:line:).md)
- [preconditionFailure(_:file:line:)](swift/preconditionfailure(_:file:line:).md)

### Exiting a Program

- [fatalError(_:file:line:)](swift/fatalerror(_:file:line:).md)
- [Never](swift/never.md)

### Querying Runtime Values

- [Mirror](swift/mirror.md)
- [ObjectIdentifier](swift/objectidentifier.md)
- [type(of:)](swift/type(of:).md)

### Customizing Your Type’s Reflection

- [CustomReflectable](swift/customreflectable.md)
- [CustomLeafReflectable](swift/customleafreflectable.md)
- [CustomPlaygroundDisplayConvertible](swift/customplaygrounddisplayconvertible.md)
- [PlaygroundQuickLook](swift/playgroundquicklook.md)
- [DebugDescription()](swift/debugdescription().md)

## See Also

### Programming Tasks

- [Input and Output](swift/input-and-output.md)
- [Macros](swift/macros.md)
- [Concurrency](swift/concurrency.md)
- [Key-Path Expressions](swift/key-path-expressions.md)
- [Manual Memory Management](swift/manual-memory-management.md)
- [Type Casting and Existential Types](swift/type-casting-and-existential-types.md)
- [C Interoperability](swift/c-interoperability.md)
- [Operator Declarations](swift/operator-declarations.md)
