I have a Note-Taking App that helps a User break down there notes based off different areas of that subject.
Details:
3 x View Controllers with a Text Field & “Next” Button
What I’m trying to achieve…
- User goes to 1st View Controller and types text into TextField, clicks next button
- Does the same for the next View Controller
- On the last view controller is shows the user the text they’ve just written in the previous view Controllers.
I’m able to pass it between 2 but not 3. See Code Below.
1ST VIEW CONTROLLER
"
@IBOutlet weak var observationText: UITextView!
public var helloworld: String = ""
override func viewDidLoad() {
super.viewDidLoad()
overrideUserInterfaceStyle = .light
observationText.becomeFirstResponder()
}
@IBAction func Next(_ sender: Any) {
self.helloworld = observationText.text!
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let vc = segue.destination as! ApplicationViewController
vc.helloworld = self.helloworld
"
LAST VIEW CONTROLLER
"
@IBOutlet weak var ObservationLabel: UITextView!
var application: String = ""
var helloworld = ""
override func viewDidLoad() {
super.viewDidLoad()
overrideUserInterfaceStyle = .light
ObservationLabel.text = helloworld
}
"
Hope this makes sense and someone able to help me!