I implement the peek & pop for my photo view.
I set the peek view controller's preferredSize to fit the photo in
- (UIViewController*)previewingContext:viewControllerForLocation:
It looks OK:
And just push it as the viewControllerToCommit in
- (void)previewingContext: commitViewController:
But when I commit the pop, I get a view controller with wrong size:
Normally the view controller should look like this:
I tried to set the frame size and preferredSize in
- (void)previewingContext: commitViewController:
but still not works.
To avoid this, I must not set the preferredContentSize, or instantiate a new view controller without setting the preferredContentSize, neither is perfect.
Am I doing any thing wrong here?