Dumps the given object’s contents using its mirror to the specified output stream.
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
@discardableResult func dump<T, TargetStream>(_ value: T, to target: inout TargetStream, name: String? = nil, indent: Int = 0, maxDepth: Int = .max, maxItems: Int = .max) -> T where TargetStream : Text Output Stream
Parameters
valueThe value to output to the
targetstream.targetThe stream to use for writing the contents of
value.nameA label to use when writing the contents of
value. Whennilis passed, the label is omitted. The default isnil.indentThe number of spaces to use as an indent for each line of the output. The default is
0.maxDepthThe maximum depth to descend when writing the contents of a value that has nested components. The default is
Int..max maxItemsThe maximum number of elements for which to write the full contents. The default is
Int..max
Return Value
The instance passed as value.