在UITabBar中添加到UIWindow视图层次结构

时间:2019-01-20 13:31:43

标签: ios swift segue uiwindow

我的问题很简单,但我找不到答案... 我有一个标签栏,我试图在视图上方添加视图以获取自定义segue动画,但是由于某种原因,当我插入Subview时,该子视图添加在标签栏层之后,而不是在AddPod视图之后的标签栏层中: 这是示例:

enter image description here

override func perform() {
    let sourceView = self.source.view as UIView
    let destinationView = self.destination.view as UIView

    destinationView.frame.origin.y = -destinationView.frame.size.height

    let window = UIApplication.shared.delegate?.window!
    window?.insertSubview(destinationView, aboveSubview: sourceView)

    UIView.animate(withDuration: 1, animations: {
                    destinationView.frame.origin.y = 0
    }, completion: {
        (value: Bool) in
        self.source.tabBarController?.present(self.destination, animated: false, completion: nil)
    })
}

0 个答案:

没有答案