I'm trying to get property information on an object in Swift. I've been able to get the names of the properties, and certain attributes, but I'm not sure how to extract the type of the property.
I've been trying to follow some of the suggestions on this objective-c related post
class func classOfProperty(parentType: AnyClass, propertyName: String) -> AnyClass?
{
var type: AnyClass?
var property: objc_property_t = class_getProperty(parentType, propertyName);
var attributes = NSString(UTF8String: property_getAttributes(property)).componentsSeparatedByString(",") as [String]
if(attributes.count > 0) {
?????
}
return type
}
Is this possible yet in Swift? If so, how?