Skip to content
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 support for comparing raw representables #27

Merged
merged 2 commits into from
Mar 3, 2024

Conversation

ftchirou
Copy link
Owner

@ftchirou ftchirou commented Mar 3, 2024

Make it straightforward to use enumerations (and other raw representables) in predicates.

Example
class Note: NSManagedObject {
  // ...
  @NSManaged var type: NoteType
}

@objc enum NoteType: Int {
  case freeForm
  case structured
}
let predicate = \Note.type == .structured

Previously, this 👆predicate would have required NoteType to conform to Primitive to compile. Not anymore.

@ftchirou ftchirou force-pushed the feature/raw-representables-predicates branch from 961f2eb to 59f4e16 Compare March 3, 2024 11:32
@ftchirou ftchirou merged commit 834065e into main Mar 3, 2024
1 check passed
@ftchirou ftchirou deleted the feature/raw-representables-predicates branch March 3, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant