私は3つのViewControllerを持っています。 Ok
アラートが表示されたボタンをクリックすると、ThirdViewController
からSecondViewController
にセグを実行したいです。私はすでにこのコードを試してみました:Xcode Swiftは警告付きのセグを実行します
alert.addAction(UIAlertAction(title: "Ok!", style: UIAlertActionStyle.default, handler: { action -> Void in
self.performSegue(withIdentifier: "ThirdViewControllerSegueBack", sender: self)
}))
問題はSecondViewController
の新しいウィンドウが現れるということですので、私はそれが戻っThirdViewController
に私をリードし、ナビゲーションバーのback
をクリックしたとき。 FirstViewController
を表示します。あなたがアンワインドを作成する必要がありますSecondViewControllerで
あなたはリラックスしたセグを必要とします:https://stackoverflow.com/questions/12561735/what-are-unwind-segues-for-and-how-do-you-use -them – Shades
ご使用のシナリオで動作する場合は試してください:https://stackoverflow.com/questions/45792130/unwind-then-segue-without-showing-intermediate-view-controller/45792543#45792543 – Amit
これを見てくださいハウツー:(巻き戻し)https://medium.com/@mimicatcodes/create-unwind-segues-in-swift-3-8793f7d23c6f – AlexWoe89