protocol CustomStringConvertible| Inheritance | View Protocol Hierarchy → |
|---|---|
| Import | import Swift |
Instance Variables
var description: String Required
A textual representation of self.
Declaration
var description: String { get }
A type with a customized textual representation.
This textual representation is used when values are written to an output stream, for example, by
print.Note:
String(instance)will work for aninstanceof any type, returning itsdescriptionif theinstancehappens to beCustomStringConvertible. UsingCustomStringConvertibleas a generic constraint, or accessing a conforming type'sdescriptiondirectly, is therefore discouraged.See Also:
String.init<T>(T),CustomDebugStringConvertible