diff --git a/examples/ASDKgram/Sample/PhotoFeedSectionController.m b/examples/ASDKgram/Sample/PhotoFeedSectionController.m index b621b0252..87cce316f 100644 --- a/examples/ASDKgram/Sample/PhotoFeedSectionController.m +++ b/examples/ASDKgram/Sample/PhotoFeedSectionController.m @@ -82,12 +82,15 @@ - (void)beginBatchFetchWithContext:(ASBatchContext *)context [self setItems:newItems animated:NO completion:nil]; } - // Start the fetch, then update the items (removing the spinner) when they are loaded. - [_photoFeed requestPageWithCompletionBlock:^(NSArray *newPhotos){ - [self setItems:_photoFeed.photos animated:NO completion:^{ - [context completeBatchFetching:YES]; - }]; - } numResultsToReturn:20]; + // Push to next runloop to give time to insert the spinner + dispatch_async(dispatch_get_main_queue(), ^{ + // Start the fetch, then update the items (removing the spinner) when they are loaded. + [_photoFeed requestPageWithCompletionBlock:^(NSArray *newPhotos){ + [self setItems:_photoFeed.photos animated:NO completion:^{ + [context completeBatchFetching:YES]; + }]; + } numResultsToReturn:20]; + }); }); }