Hier ist die Objective-C-Version.So verweisen Sie auf einen Typ selbst in Swift
+ (NSDictionary *)modelContainerPropertyGenericClass {
return @{
"picIds" : String,
"picInfos" : [WBPicture class]
};
}
Ich habe es auf diese Weise, aber der Compiler warf den Fehler
static func modelContainerPropertyGenericClass() -> [String: AnyClass] {
return [
"picIds" : String.self,
"picInfos" : WBPicture.self
]
}
Sie haben eine zusätzliche Klammer ']' im Array-Konstruktor – redent84