swift3 - Protocol Property Allowed With Realm? -
i'm trying model data.
i have class contains optional property of type excercisecontent.
import realmswift class excercise: object { var content: excercisecontent? }
the idea excercise contains content, duration, , 1 of two: audio or text.
protocol excercisecontent { var duration: int { } } protocol audioexcercisecontent: excercisecontent { var audio: string { } } protocol textexcercisecontent: excercisecontent { var text: string { } }
i found similar question, know if still applies, , response means "realm needs know concrete object type linked @ initialization time."
i've declared protocol, shouldn't realm know object type? or object type different every time, , that's why can't done?
realm needs know concrete object type linked @ initialization time..
your content
property should either realm object or 1 of supported property types.
Comments
Post a Comment