This repository has been archived by the owner on Jun 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
rcedwards
commented
Nov 24, 2015
- Added a type safe Fetched Results Controller thanks to @jgallagher and @zwaldowski
- Updated the sample project with an example
- Wrote unit test cases around the FRC
- Updated the docs with better Markdown sugar
This helps illustrate the view controllers being swapped out when the stack is finished being constructed.
John G. had discovered the documented compiler issue observed when switching on the enum Compiler emits "PHI node operands are not the same type as the result!"
Previously all 100 books were being inserted here. That has been moved to the setup func so instead we'll just insert a single new book.
…errors are thrown on functions
sectionNameKeyPath: "firstInitial") | ||
let frcDelegate = BooksFetchedResultsControllerDelegate(tableView: self.tableView) | ||
frc.setDelegate(frcDelegate) | ||
return frc |
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.
The FRC delegate should be weak
, so shouldn't the frcDelegate
be owned strongly somewhere?
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.
got it. Updated.
This initializer takes a custom sort predicate however it was not being used at this time. This use of sort (and related ones) is problematic, as it might cause I/O to fetch all the objects in a section — Core Data arrays are lazy.
…r a given change An insert should have a newIndexPath, a delete should have an older indexPath etc. This way NSIndexPath? instances aren't being forcibly unwrapped.
I believe I've addressed everything if someone else wants to give a quick run through. |
Work around a bug in Xcode 7.0 and 7.1 when running on iOS 8 - updated objects sometimes result in both an Update *and* and Insert call to didChangeObject, which makes no sense. Thankfully the bad Inserts have a non-nil "old" indexPath (which also makes no sense) - we check for that here and ignore those erroneous messages. For more discussion, see https://forums.developer.apple.com/thread/12184
@zwaldowski gotcha. Updated |
👍 We're well on our way to a great next release! |
zwaldowski
added a commit
that referenced
this pull request
Dec 1, 2015
…ntroller Type safe fetched results controller
This was referenced Dec 1, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.