What are Swift Metatypes (Part 1)
A metatype is a type of a type. OK post done…..jk
Metatypes are used to access properties and methods (including initializers) belonging to a type - in contrast to an instance. Every time you use a static property or function, you are using a Metatype.
|
|
They are helpful for generic code. In fact, Codable & UITableView have methods using parameters of X.Type.
To be continued…
Originally published 09/15/2022 @ https://pittcsc.org/ Discord
Published here on 09/20/2022. Blog published date reflects the original date of publication.