我需要创建这样的东西:
import RealmSwift
class UserObject: Object {
@Persisted var ageRange: ClosedRange<Int>
}
但我收到了错误Generic struct 'Persisted' requires that 'ClosedRange<Int>' conform to '_Persistable'
如何将ClosedRange<Int>
映射到Realm支持的单个对象(而不是将ClosedRange<Int>
分成2个Int)?
附注:可能有类似的问题,但它们都是关于较旧的RealmSwift版本,不涉及@Persisted