怎麼使用自定義segue,實現波紋跳轉

modal無法實現,push可能能夠實現。

modal

presentModalViewController:animated:completion:^(void){ //code };

dismiss方法

dismissModalViewControllerAnimated:                 // 將要廢棄,不贊成繼續使用
dismissViewControllerAnimated:completion:

CustomSegue

-(void)perform{

    CATransition* animation = [CATransition animation];

    [animation setDuration:0.5f];

    [animation setType:@"rippleEffect"];//波紋效果 @“rippleEffect”

    

    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];

    

    [[[self.destinationViewController view] layer] addAnimation:animation forKey:@"transition"];


    [[self sourceViewController] presentViewController:self.destinationViewController

                                                    animated:NO

                                                  completion:Nil];

    

}

push



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章