-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add keyPath initializer for Persisted<LinkingObjects> #8136
base: master
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Jason Flax.
|
needs a changelog entry |
RealmSwift/PersistedProperty.swift
Outdated
@@ -361,6 +361,9 @@ extension Persisted where Value: LinkingObjectsProtocol { | |||
public init(originProperty: String) { | |||
self.init(wrappedValue: Value(fromType: Value.Element.self, property: originProperty)) | |||
} | |||
public init<V>(originProperty: KeyPath<Value.Element, V>) where Value.Element: ObjectBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This'll allow specifying any type of property as the origin property and ideally it'd be constrained to links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Jason Flax.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our test doesn't seem to like the use of this
EXC_BAD_ACCESS (code=2, address=0x16f603bb8).
No description provided.