How to switch to another window using the button (For example: from VievController to TabbleViewController), while it is necessary that the button perform certain commands with the background (For example: assign the text written on the button to the label in another window)?
- what you tried, what did not work? - Max Mikheyenko
- To be honest, I just don’t know how to do it. I know that you can bind with CTRL, but I don’t know how to do side effects. - Goncharoff
- @Goncharoff Specify in the labels the question of which operating system is it being referred to (iOS, tvOS or macOS). And why are you writing about CTRL? - Roman Podymov
- I mean: if you hold down the CTRL on the button and drag it to the desired window, this button will open this window. (Operating system - iOS) - Goncharoff
- @MaxMikheyenko have any options? - Goncharoff
|
1 answer
Use to go to the new controller
performSegue(withIdentifier: "ваш сигвей(переход)", sender: nil) Use to prepare the transition
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "ваш сигвей(переход)" { let nav = segue.destination as! ВашViewController nav.переменная(открываемого контроллера) = "Дядя Вася" } } |