The Parse documentation for adding properties and methods on PFObject subclasses conveniently skips the Swift syntax in their sample code listing just the Objective-C syntax:
https://parse.com/docs/ios_guide#subclasses-properties/iOS
// Armor.h
@interface Armor : PFObject<PFSubclassing>
+ (NSString *)parseClassName;
@property (retain) NSString *displayName;
@end
// Armor.m
@dynamic displayName;
Has anyone figured out a work around for Swift's lack of dynamic synthesizers in order to implement properties and methods with PFSubclassing? I want to be able to do something like:
class Armor : PFObject, PFSubclassing {
class func parseClassName() -> String! {
return "Armor"
}
}
var armor = Armor()
armor.displayName = "Iron Clad"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…