UINavigationController Push Segue 在 iOS11 中不起作用,没有后退按钮,没有标题

UINavigationController Push Segue doesn't work in iOS11, No back button, No title

我有一个 tabbar 和一个 navigation controller ,当我向视图显示一个新的情节提要时 navigation controller 作为它的初始控制器。

let storyboard = UIStoryboard.init(name:"AccountMenu", bundle: nil)
let viewController = storyboard.instantiateViewController(withIdentifier:"AccountMenuRootVC") as! AccountMenuRootVC
present(viewController, animated: true, completion: nil)

结果按预期工作 ios 10

但是在ios11中,导航控制器不工作。

看起来初始导航控制器卡在那里并且没有更新。

我也试过添加这个,但没有成功

if #available(iOS 11.0, *) {
    tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentBehavior.never
    self.navigationController?.navigationBar.prefersLargeTitles = false
    self.navigationItem.largeTitleDisplayMode = .never
}

有什么建议吗?

一如既往,答案在其他地方,我登录后的初始转场是自定义转场

https://github.com/oyvind-hauge/OHCircleSegue/blob/master/OHCircleSegue/OHCircleSegue.swift

原来 CAAnimationDelegate 函数从未被调用 但 window?.insertSubview(destView!, aboveSubview: sourceView!) 正在替换视图,因此将以下内容添加到自定义 segue 解决了这个问题。

func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
    source.present(destination, animated: false, completion: nil)
}