Skip to content
This repository has been archived by the owner on Jan 7, 2018. It is now read-only.

Commit

Permalink
Prevent nasty Auto Layout bugs.
Browse files Browse the repository at this point in the history
I was experiencing nasty Auto Layout's constraints infringements. Solved 'em by `reloadData'-ing when not on-screen.
  • Loading branch information
giovatardu committed Jun 6, 2013
1 parent 65d99a1 commit aaac41c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AFMasterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller
if ([_objectChanges count] > 0 && [_sectionChanges count] == 0)
{

if ([self shouldReloadCollectionViewToPreventKnownIssue]) {
if ([self shouldReloadCollectionViewToPreventKnownIssue] || self.collectionView.window == nil) {
// This is to prevent a bug in UICollectionView from occurring.
// The bug presents itself when inserting the first object or deleting the last object in a collection view.
// http://stackoverflow.com/questions/12611292/uicollectionview-assertion-failure
Expand Down

0 comments on commit aaac41c

Please sign in to comment.