在Swift 2中没有关于segue的后退按钮

我把我的项目移植到Swift 2上,一切都很好 – 除了最简单的segue没有后退按钮。 这是我正在使用的segue函数的准备:

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. if segue.identifier == "showExercise" { if let nav = segue.destinationViewController as? UINavigationController { if let exercisesController = nav.topViewController as? ExercisesController { let cell = sender as! WorkoutCell if let workout = cell.name!.text { exercisesController.exercises = Workouts[workout]! exercisesController.navigationItem.title = workout } } } } } 

之前,父segue的后退按钮用于自动填充。 现在,我得到的只是儿童导航vc中的标题

你在使用show或show detail segue吗? 看起来你正在使用模态segue。 show或show segue的目标视图控制器通常是第二个视图控制器本身,而不是嵌入在另一个UINavigationController

如果show segue的目标视图控制器实际上是UINavigationController ,则新导航控制器的导航栏设置可能会覆盖旧的导航栏设置(源视图控制器的导航控制器)。 尽量不要将目标视图控制器嵌入另一个UINavigationController