CustomReflectable

protocol CustomReflectable

A type that explicitly supplies its own mirror.

Conforming Types AnyHashable, Array, ArraySlice, Bool, Character, ClosedRange, CollectionOfOne, ContiguousArray, CustomLeafReflectable, Dictionary, Dictionary.Iterator, Double, Float, Float80, Int, Int16, Int32, Int64, Int8, Mirror, Optional, Range, Set, Set.Iterator, StaticString, StrideThrough, StrideTo, String, String.UTF16View, String.UTF8View, String.UnicodeScalarView, Substring, UInt, UInt16, UInt32, UInt64, UInt8, Unicode.Scalar

You can create a mirror for any type using the Mirror(reflecting:) initializer, but if you are not satisfied with the mirror supplied for your type by default, you can make it conform to CustomReflectable and return a custom Mirror instance.

Instance Variables

var customMirror Required

The custom mirror for this instance.

If this type has value semantics, the mirror should be unaffected by subsequent mutations of the instance.

Declaration

var customMirror: Mirror