Switch between ModalViews

Scenario:
1. Show the navigation device based on the controller
2. User selection - 3. Show modal view A
4. The user selects another option in modal form. 5. Hide modal view A
6. Show modal view B

// This function must show modal view A
This scenario implemented like this:
- (IBAction)showModalViewA:(id)sender {
    ModalViewA *viewA = [[ModalViewA alloc] forParent:self];
    [self presentModalViewController:viewA animated:YES];
    [viewA release];
}

// This function must hide modal view A and show modal view B
- (void)didSelectOptionInViewA {
    ModalViewB *viewB = [[ModalViewB alloc] init];
    viewB.peoplePickerDelegate = self;

    [self dismissModalViewControllerAnimated:NO];            // Problem Is Here
    [self presentModalViewController:viewB animated:YES];
    [viewB release];
}

Look at the line marked as // The problem is here
When I set rejectModalViewControllerAnimated: NO , it works fine. If this parameter is YES , then viewB is not displayed on the screen.

How to make it work with animation?

+1
1

, - 0,3 . , ( ), 2 :

  • ​​0,3 . , , , .
  • - (, ), YES ( , ). - [UIViewController viewDidAppear:] , .
    • , .
    • .

, , Apple-ish. , , .

0

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


All Articles