How to replace the modal view controller?

I am using a modal view controller so that the user can select the address book entry and email address. The ABPeoplePickerNavigationController object ABPeoplePickerNavigationController displayed through presentModalViewController:animated :

 [self presentModalViewController:picker animated:YES]; 

What I want to do is to keep the dialog upward modal, but when the user selects an email address, he must Shadow to another controller that displays the message box.

I tried various approaches in peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier: to reject the collector and set my custom composition controller as a modal view. I can do this any number of ways, but it never makes it disappear smoothly from the picker to the composition controller - if I do not make the composition controller a modal dialog of the collector, in this case Picker appears again when I dissolve the composition controller. I don’t want that either.

There must be some way to smoothly replace one controller and its appearance with another controller and its presentation, all in the context of a modal dialogue and preferably with cross-fading. Suggestions were highly appreciated.

+4
source share
1 answer

Add a composition controller as the subtitle of your collector. Set its alpha to 0 so that it is transparent. Then use the animation block to gradually animate your alpha to full:

 // Initially set alpha to 0 [myCompositionView setAlpha:0]; // Later when you want to show the view, animate the alpha to 1.0 [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.5]; [myCompositionView setAlpha:1.0]; [UIView commitAnimations]; 
+1
source

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


All Articles