I have a problem. I change the scale, as well as the transition of the UICollectionViewCell , because to increase the fingers the position of the fingers makes UIPinchGesture. But after that, the position of the view changes, and the view disappears from the screen and its borders. I want the Gesture View to return to the correct position.
This is what happens:

I tried to assign the CGAffineTransformIdentity view if the center of the cell changed, but after Scale and Translate its center always changes, so its frame also.
Code in UIGestureRecognizerStateEnded :
if ([gesture state] == UIGestureRecognizerStateEnded){ //Get the Cell that is getting zoomed CGPoint initialPinchPoint = [gesture locationInView:self.collectionView]; NSIndexPath* pinchedCellPath = [self.collectionView indexPathForItemAtPoint:initialPinchPoint]; SBQPhotosDetailCollectionViewCell *cell=[[SBQPhotosDetailCollectionViewCell alloc] init]; cell=(SBQPhotosDetailCollectionViewCell *)[self.collectionView cellForItemAtIndexPath:pinchedCellPath]; //Check ifs frame with the gesture of the Pinch if ((cell.frame.origin.x != [gesture view].frame.origin.x) || (cell.frame.origin.y != [gesture view].frame.origin.y)){ [gesture view].transform = CGAffineTransformIdentity; } }
I would like to apply CGAffineTransformIdentity only if the Gesture view changes its center , position , but not if the view got zoomed .
thanks
source share