objective c - Getting class from string in swift -
i have created custom class named predicatecontroller
.
i need pass class of predicatecontroller called framework written in objc. however, whenever using properties of swift, same returning me <projectname>.predicatecontroller
.
i need class name predicatecontroller
.
is there workaround in swift same.
thanks.
you can type of class using self
on class , wrap string, e.g. ...
let date = nsdate(); let clazz = nsdate.self let str = "\(date) of type \(clazz)" println(str)
Comments
Post a Comment