#pragma mark - peek的代理方法,轻按即可触发弹出vc
- (
UIViewController *)previewingContext:(
id )previewingContext viewControllerForLocation:(
CGPoint)location{
NSIndexPath *indexPath = [
self.collectionView indexPathForCell:(UICollectionViewCell* )[previewingContext sourceView]];
PreviewViewController *vc = [[PreviewViewController alloc] init];
vc
.preferredContentSize = CGSizeMake(
0,
200);
return vc;
}
#pragma mark - pop的代理方法,在此处可对将要进入的vc进行处理
- (
void)previewingContext:(
id )previewingContext commitViewController:(
UIViewController *)viewControllerToCommit
{
[
self pushToMediaPreview:indexPath andNoAnimation:
YES];
}