Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 自定义解卷segue类在Swift中无法正常工作,为什么?_Ios_Swift - Fatal编程技术网

Ios 自定义解卷segue类在Swift中无法正常工作,为什么?

Ios 自定义解卷segue类在Swift中无法正常工作,为什么?,ios,swift,Ios,Swift,以下展开分段类未将原始VC呈现为其原始状态,并从左向右滑动-->|并在将数据向右分段到辅助VC后按预期重新加载数据 原始VC位于UITabBarController中,底部的选项卡栏仍在显示,但屏幕的其余部分为空白 问题:如何将初始序列恢复到辅助屏幕? class UnwindSegueFromRight: UIStoryboardSegue { override func perform(){ let src = self.source let dst = self.des

以下展开分段类未将原始VC呈现为其原始状态,并从左向右滑动-->|并在将数据向右分段到辅助VC后按预期重新加载数据

原始VC位于
UITabBarController
中,底部的选项卡栏仍在显示,但屏幕的其余部分为空白

问题:如何将初始序列恢复到辅助屏幕?

class UnwindSegueFromRight: UIStoryboardSegue {

override func perform(){

    let src = self.source
    let dst = self.destination


    src.view.superview?.insertSubview(dst.view, at: 0)
    dst.view.transform = CGAffineTransform(translationX: -src.view.frame.size.width, y: 0)

    UIView.animate(withDuration: 0.25,
                   delay: 0.0,
                   options: UIViewAnimationOptions.curveEaseInOut,
                   animations: {
                    dst.view.transform = CGAffineTransform(translationX: 0, y: 0)
    },
                   completion: { finished in

                    src.dismiss(animated: false, completion: nil)
    })
}
}//end class
我有下面的
SegueFromRight
类,它工作得非常好。但是,我相应的上述放松顺序不起作用

class SegueFromRight: UIStoryboardSegue {

override func perform(){

    let dst = self.destination
    let src = self.source


    src.view.superview?.insertSubview(dst.view, aboveSubview: src.view)

    dst.view.transform = CGAffineTransform(translationX: src.view.frame.size.width, y: 0)

    UIView.animate(withDuration: 0.25,
                   delay: 0.0,
                   options: UIViewAnimationOptions.curveEaseInOut,
                   animations: {
                    dst.view.transform = CGAffineTransform(translationX: 0, y: 0)
    },
                   completion: { finished in
                    src.present(dst, animated: false, completion: nil)
    })
}
}

你应该尝试而不是
src.disclease(动画:false,完成:nil)
来执行
dst.disclease(动画:false,完成:nil)
@Ladislav你建议的更改将展开回原始VC,但它不执行转换动画(从左到右),有什么想法吗?