How to pass data between View Controllers in Swift (iOS)?
Hi everyone! I'm a beginner in iOS development with Swift and I can't figure out how to pass data between screens. I have two View Controllers: `FirstViewController` and `SecondViewController`. The first one has a text field (UITextField), and I want the text from this field to be displayed in a UILabel in the second View Controller after a button press.\n\nI tried passing data through a segue, but I can't get it to work. Here's my code:\n\n```swift\n// FirstViewController.swift\nimport UIKit\n\nclass FirstViewController: UIViewController {\n @IBOutlet weak var textField: UITextField!\n\n override func prepare(for segue: UIStoryboardSegue, sender: Any?) {\n if segue.identifier == "showSecondVC" {\n let secondVC = segue.destination as! SecondViewController\n se