Swift クラス名取得

Objective-cでは
NSString * className = NSStringFromClass([self.class]);
でしたが、Swiftでは
let type = Mirror(reflecting: self).subjectType
let className = String(type)
で取得できるみたいです。 メモメモ


コメント

このブログの人気の投稿

2018年の振り返りと2019年の目標

転職しました

唾石症日記1