In iOS we can use Storyborad and segue to implement our own scene switching animations, and the new project uses the single View application template and is named Mycustomsegue.
Use storyboard to hold out another uiviewcontroller and set the two controller's view color and set the segue of the jump page to custom
Set up
New file Mycustomchangesegue and re-perform method
1 @implementationMycustomchangesegue2 3-(void) Perform4 {5Uiviewcontroller *sourceviewcontroller =Self.sourceviewcontroller;6Uiviewcontroller *destviewcontroller =Self.destinationviewcontroller;7 8[UIView animatewithduration:1animations:^{9Cgpoint CenterPoint =SourceViewController.view.center;TenSourceViewController.view.frame = CGRectMake (Centerpoint.x,centerpoint.y,0,0); OneSourceViewController.view.alpha =0; A} completion:^(BOOL success) { -UIView *destview =Destviewcontroller.view; -SourceViewController.view.hidden =YES; the [[Sourceviewcontroller.view Superview] addsubview:destview]; -CGRect Destrect =Destview.frame; -Cgpoint CenterPoint =Destview.center; -Destview.frame = CGRectMake (Centerpoint.x,centerpoint.y,0,0); +Destview.alpha =0; -[UIView animatewithduration:0.3animations:^{ +Destview.frame =Destrect; ADestview.alpha =1; at} completion:^(BOOL success) { -Destview.alpha =1; -Destview.frame =Destrect; -SourceViewController.view.hidden =NO; - [Sourceviewcontroller presentviewcontroller:destviewcontroller animated:no Completion:nil]; - }]; in }]; - } to + @end
Run the program click the Go button and we'll see a magical scene!
iOS custom scene toggle animation.