casillas
casillas

Reputation: 16793

ViewController disable interaction - iOS

I decided to collect data from users. And I started adding viewController on the top of mainViewController as also shown in the image below. My problem is that user could able to interact mainViewcontroller, which mapKit in my case.Whenever user scrolls picker view, it also affects mapViewController at the button!

I dont want user to be able to interact with the mainViewController.

enter image description here

Upvotes: 2

Views: 2153

Answers (2)

picciano
picciano

Reputation: 22701

Another approach would be to take a screenshot of the mainViewController view and use that image as the background to your gender and age collection view. That would have the advantage of only requiring a single view controller to be displayed, perhaps conserving memory.

Upvotes: 2

picciano
picciano

Reputation: 22701

You could disable user interactions of the mainViewController when the overlay is shown, as follows:

mainViewController.view.userInteractionEnabled = NO;

Upvotes: 4

Related Questions