| Instance | Type |
|---|---|
| ”Hello World” | String |
String.self or type(of:"Hello") | String.Type |
- A metatype is simply a type with
.Typeappended to it, e.g.String.Type - A metatype instance can be specified by appending
.selfto a type, e.g.String.self - To get a metatype instance at runtime, simply pass an instance to
type(of:) - Metatypes allow access to properties, methods, and initializers belonging to the type.