www.youtube.com try! Swift 2019 kateinoigakukunです。メルカリでインターンをしています。 今日はSwiftを理解するために重要なメタデータについて話します。Swiftは静的型付けな言語として知られていますが、 実はランタイムにおいては動的な部分が多々あるのです。 let typeName = String(describing: Int.self) 皆さんもStackOverflowを見て、一度はこんなコードを書いて型名を取得したことがあるでしょう。 extension UITableView { func register<Cell>(nibWithCellClass: Cell.Type) where Cell: UITableViewCell { let typeName = String(describing: Cell.self) l
![Swift Type Metadata (ja) - kateinoigakukunのブログ](https://cdn-ak-scissors.b.st-hatena.com/image/square/1feea12a304ca57db16add198c80700237d2de1a/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fk%2Fkateinoigaku%2F20190322%2F20190322173349.jpg)