Skip to content

Commit

Permalink
Shortcut for adding all ManagedObject extensions (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
spnkr authored Dec 29, 2022
1 parent 24d13b9 commit 7eb9cf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ import CoreDataPlus
// An existing NSManagedObject
public class Drawing: NSManagedObject { }

extension Drawing: ManagedObjectPlus {

}
```

You can also import just the features you want to use by replacing `ManagedObjectPlus` with one or more of the available `ManagedObject*` protocols:

```swift
extension Drawing: ManagedObjectDeletable,
ManagedObjectCountable,
ManagedObjectSearchable,
Expand Down
2 changes: 2 additions & 0 deletions Sources/CoreDataPlus/ManagedObjectPlus.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// Shortcut for adding all ManagedObject extensions
public typealias ManagedObjectPlus = ManagedObjectCountable & ManagedObjectDeletable & ManagedObjectSearchable & ManagedObjectFindOrCreateBy

0 comments on commit 7eb9cf3

Please sign in to comment.