The appearance controller hides during user selection

I am trying to create a custom segment so that the destination view controller moves from above.

I wrote my code according to the example from the documentation .

The problem is that when you run segue, the source view controller turns black, and then the animation happens. How can I prevent the view controller of the source image from getting black?

(I already tried to implement the solution presented in this answer , but after switching to the black screen or returning to the controller of the original form.)

Here is my code:

-(void)perform{

    UIViewController *splashScreen = self.sourceViewController;
    UIViewController *mainScreen = self.destinationViewController;

    //Place the destination VC above the visible area        
    mainScreen.view.center = CGPointMake(mainScreen.view.center.x,
                                          mainScreen.view.center.y-600);

    //Animation to move the VC down into the visible area
    [UIView animateWithDuration:1
                     animations:^{
                         mainScreen.view.center = CGPointMake(mainScreen.view.center.x, [[UIScreen mainScreen] bounds].size.height/2 );
                     }
     ];

    [splashScreen presentModalViewController:mainScreen animated:NO];
}
+5
source share
1

, , , .

, .

  • ,
  • ,
  • , , , .

, push view, . .

+3

All Articles