Objective-C风格获取对象类型:
let date = NSDate()
let name: AnyClass! = object_getClass(date)
debugPrint(name) // __NSDate
Swift 风格获取对象类型:
let date1 = NSDate()
let name1 = type(of: date)
debugPrint(name1) // __NSDate
let str = "hello"
let name2 = type(of: str)
debugPrint(name2) // Swift.String