In order to store a class name in a log file I converted the description of a class type to a string:
let objectType: NSObject.Type = Object.self
let str = String(describing: objectType)
However, I do not succeed in back conversion of str
to a variable of type NSObject.Type
to use it in a generic method.
How could I do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…