如何删除UINavigationController
的动画?我没有为此在UINavigationController
中找到属性。自定义类只是一种方法吗?
答案 0 :(得分:0)
您可以在故事板上执行此操作
在代码中,您可以执行以下操作:
@IBAction private func nextTapped() {
let storyBoard = UIStoryboard(name: "Main", bundle: nil)
guard let otherViewController = storyBoard.instantiateViewController(withIdentifier: "OtherViewController") as? OtherViewController,
let navigationController = navigationController else {
return
}
// when you push the view controller, pass in animated as false
navigationController.pushViewController(otherViewController, animated: false)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next",
style: .plain,
target: self,
action: #selector(nextTapped))
}