Ответ 1
Существует много публичных репозиториев на git, которые могли бы делать то, что вы хотите. Некоторые вещи, которые я нашел:
https://github.com/mariohahn/MHVideoPhotoGallery
https://github.com/mwaterfall/MWPhotoBrowser
Это может быть слишком сложно. Другой вариант - создать UIImageView в том же месте, что и ячейка, а затем оживить его, чтобы заполнить экран. Этот код предполагает, что collectionView имеет начало координат в (0,0), если нет, то просто добавьте смещение collectionView при вычислении исходного кадра.
collectionView.scrollEnabled = false; // disable scrolling so view won't move
CGPoint innerOffset = collectionView.contentOffset; // offset of content view due to scrolling
UICollectionViewLayoutAttributes *attributes = [collectionView layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:index inSection:0] ];
CGRect cellRect = attributes.frame; // frame of cell in contentView
UIImageView *v = [[UIImageView alloc] initWithFrame:CGRectMake(cellRect.origin.x - innerOffset.x, cellRect.origin.y - innerOffset.y, cellRect.size.width, cellRect.size.height)];
[self.view addSubview:v]; // or add to whatever view you want
v.image = image; // set your image
v.contentMode = UIViewContentModeScaleAspectFit; // don't get stupid scaling
// animate
[UIView animateWithDuration:0.5 animations:^{
[v setFrame:[[UIScreen mainScreen] bounds]]; // assume filling the whole screen
}];
Это не симпатичная анимация, но она все равно выглядит нормально.