Right now I have 2 buttons that segue the textfield data from vc1 to vc2. I would like to have the top button segue whatever is in the textfield to vc2. I would like the bottom button to just segue to the next vc. Right now both buttons segue the data from the textfield to the next vc.
import UIKit
class ViewController: UIViewController {
@IBOutlet var textfield: UITextField!
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let c2 = segue.destination as? twoViewController else {return}
c2.ss = textfield.text
}}
class twoViewController: UIViewController {
var ss: String!
@IBOutlet var datalbl: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
datalbl.text = ss
}}