0
私はあなたのために簡単なものを持っています。私はUITableviewController
に戻るボタンを作成し、その戻るボタンを私の他のUIViewController
(NewTableViewController)に設定したいと思います。ここ1つのviewcontrollerから他のviewcontrollerに戻る方法
私はボタン
let newBackButton = UIBarButtonItem(title: "Back", style: UIBarButtonItemStyle.plain, target: self, action: #selector(NewTableViewController.back(sender:)))
self.navigationItem.leftBarButtonItem = newBackButton
をバックimplemementとアクションが
func back(sender: UIBarButtonItem) {
// perform your custom action
//....
// go back to the previuos view controller
_ = navigationController?.navigationController?.self.dismiss(animated: true)
}
ですが、私は戻って助け君たちのために
感謝を行くことができません。私が逃していることを教えてください。
を使用する場合は、モデル・ビュー・コントローラ
OR
を使用する場合は、SWIFT 3
のためにこれを試してみてくださいバックBを作成する必要はありませんあなたはモーダルショーを使うなら 'popViewController'を使わずに' self.dismiss'を使います – Tj3n
navigationController?.popViewController –
イメージの代わりにコードをスニペットとして追加する必要があります:) –