Initializer

init(reflecting:)

Creates a mirror that reflects on the given instance.

Declaration

init(reflecting subject: Any)

Parameters

subject

The instance for which to create a mirror.

Discussion

If the dynamic type of subject conforms to CustomReflectable, the resulting mirror is determined by its customMirror property. Otherwise, the result is generated by the language.

If the dynamic type of subject has value semantics, subsequent mutations of subject will not observable in Mirror. In general, though, the observability of mutations is unspecified.