あなたが達成しようとしているのは、あるタブから別のタブにデータを渡すことです。
は「今、どのように私はセグエでまずタブ付きページに戻ることができますか?私はDBへのクエリを実行するためにパラメータを渡す必要がありますので。」
を実際に、あなたドン「トンではなく、あなたが次の操作を行うことができ、データを渡すためにセグエを実行する必要があります。
// somewhere in your code when you need to pass data to another tab viewController:
if let tabBarController = tabBarController {
let secondTabViewController = tabBarController.viewControllers![1] as! SecondViewController
// let's assume that you want to pass a string
secondTabViewController.str = "my str!!"
}
SecondViewController:
class SecondViewController: UIViewController {
// here is the string that had been passed from the first tab viewController:
var str:String?
override func viewDidLoad() {
super.viewDidLoad()
// note that the output is: "Optional("my str!!")"
print(str)
// do optional binding:
if let unwrappedStr = str {
// output is: "my str!!"
print(unwrappedStr)
}
}
}
私はそれが助けてくれることを願っています。
戻るには巻き戻し用セグを使用する必要があります – Paulw11