First of all, the sourceView must have a cornerRadius on its layer, indeed, the blur effect will have an angular radius only if the sourceView layer has one. Since sourceView is readonly, it must be set when registration is done using the method registerForPreviewingWithDelegate:sourceView:.
, collectionView:cellForItemAtIndexPath:. , Context , previewingContext, registerForPreviewingWithDelegate:sourceView: :
if (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable) {
id previewingContext = [self registerForPreviewingWithDelegate:self sourceView:cell];
cell.weakPreviewingContext = previewingContext;
}
collectionView:didEndDisplayingCell:forItemAtIndexPath: UICollectionViewDelegate :
if (collectionView == self.collectionView) {
if ([cell isKindOfClass:UserInHomeCollectionCell.class]) {
[self unregisterForPreviewingWithContext:((UserInHomeCollectionCell*)cell).weakPreviewingContext];
}
}
, previewingContext:viewControllerForLocation: UIViewControllerPreviewingDelegate :
UserInHomeCollectionCell *cell = (UserInHomeCollectionCell*)[(UIViewController*)previewingContext view];
NSAssert([cell isKindOfClass:UserInHomeCollectionCell.class], @"***** INTERNAL ERROR: Invalid class for retrieved cell %@", cell);
NSAssert([previewingContext isEqual:((UserInHomeCollectionCell*)cell).weakPreviewingContext], @"***** INTERNAL ERROR: Invalid Previewing Context");