3D Touch, Peek & Pop with different frame sizes

I implement peek and pop to view photos.

I set the option to view the view in PDF to fit the photo in

- (UIViewController*)previewingContext:viewControllerForLocation:

Everything looks fine:

enter image description here

And just click it as viewControllerToCommit in

- (void)previewingContext: commitViewController:

But when I commit pop, I get a view controller with the wrong size: enter image description here

Typically, a view controller should look like this:

enter image description here

I tried setting the frame size and preferredSize to

- (void)previewingContext: commitViewController:

but still not working.

To avoid this, I should not install preferredContentSize or create a new view controller without installing preferredContentSize, and this is not ideal.

Am I doing something wrong here?

+4
source share

Source: https://habr.com/ru/post/1651776/


All Articles