0
votes

I'm not sure if I can do this in this way, but let's have a try with smarter people then me.

I want to be able to move the frame of presented controller by dragging it. I'm expecting to see controller in which I've invoked the [self presentModalViewController:anotherVC animated:YES]; below the presented one. I'm seeing white background thou.

In order to achive this functionality without presenting modal view controller I could add subview i.e.:

[self.view addSubview:anotherVC.view];

But is there a way to move modal presented view controller and be able to see view from which this modal controller is presented in?

1

1 Answers

0
votes

If you need to display the parent view behind the modal view, then you can use this code:

Set your anotherVC.view.frame less than your parent view.

anotherVC.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:anotherVC animated:YES]; 

But the visible portion of the parent view will be dimmed for preventing the interaction.

UIModalPresentationFormSheet

The width and height of the presented view are smaller than those of the screen and the view is centered onscreen. If the device is in a

landscape orientation and the keyboard is visible, the position of the view is adjusted upward so the view remains visible. All uncovered areas are dimmed to prevent the user from interacting with them.

Modal Presentation Styles