在不使用按钮的情况下导航到动画视图末尾的第二个vc

时间:2015-06-01 06:31:17

标签: ios swift

如何在不使用按钮的情况下导航到动画视图末尾的第二个vc?

我已经看了一些教程,但在每个视频中,他们都是通过使用按钮来解决这个问题...

你能帮助我吗?

2 个答案:

答案 0 :(得分:0)

只需在完成功能块中添加performSegueWithIdentifier,如下所示

UIView.animateWithDuration(0.25, delay: 0, options: UIViewAnimationOptions.CurveEaseInOut, animations: {

 //your animations

}, completion: {

// your segue, for example
//self.performSegueWithIdentifier("signInView", sender: self)

})

答案 1 :(得分:0)

您需要使用此代码

动画结束后:

[self performSegueWithIdentifier:@"GoSecondVC" sender:self];

并在当前的第一个vc中覆盖此方法:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

{

if ([[segue identifier] isEqualToString:@"GoSecondVC"])
{
    // Get reference to the destination view controller
    YourSecondViewController *vc = [segue destinationViewController];

    // Pass any objects to the view controller here, like...
    [vc setMyObjectHere:object];
}

}