mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Swift 3 NSFetchedResultsController #99
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @colinmorelli on GitHub (Nov 10, 2016).
Making this to track an effort on opening up
NSFetchedResultsControllerfor Swift 3. I took a stab at it tonight, but I'm guessing the reason it was commented out in the first place is the same reason I eventually gave up for now: Objective-C generics?As an alternative (and yes, I acknowledge how hard you've worked to make this not the case), would you consider exposing the
NSManagedObjectContextinstances? I've actually found multiple use cases for having access to them and am starting to feel that, given the correct caveats all over the documentation, it could be useful to provide.In any case, is there any way (as is) to use an NSFRC in Swift 3?
@JohnEstropia commented on GitHub (Nov 10, 2016):
@colinmorelli Thanks for bringing this up! As you have suspected, I removed the NSFetchedResultsController factory methods because during the Swift 3 beta builds there was no way to cast Objective-C "generic" types to each other:
Fortunately Swift 3 now allows inter-casting with
as!. I'll try to recover the commented-out code and see how much we can still use@JohnEstropia commented on GitHub (Nov 10, 2016):
Can you share these use cases? I'm trying out an architecture right now where the context can be accessed if needed, BUT I'd like it to be a last resort and if there are use cases where the context needs to be exposed I'd prefer that CoreStore has it's own abstraction over that.
@JohnEstropia commented on GitHub (Nov 11, 2016):
@colinmorelli NSFetchedResultsController utilities are available again!
For usage samples, see
33a5c123aa (diff-a64622bdb6bd86124110367af47fe690R251)for Objective-C,or
33a5c123aa (diff-17dc834c37c9b798806970e232364293R41)for Swift 3.As for API's to expose the internal NSManagedObjectContext, please wait for a new protocol in an upcoming version I am currently implementing.
@colinmorelli commented on GitHub (Nov 11, 2016):
Awesome - new apis for NSFetchedResultsController working great 👍
@JohnEstropia commented on GitHub (Nov 15, 2016):
@colinmorelli Check out
b230ed6400 (diff-dd90dc4a77a046f05e715c4c0ea209d2R40)The
FetchableSourceandQueryableSourceexposes