Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class NewCourseViewController: UIViewController {
- @IBOutlet weak var courseNameTextField: UITextField!
- override func viewDidLoad() {
- super.viewDidLoad()
- }
- override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
- // Get the new view controller using segue.destinationViewController.
- // Pass the selected object to the new view controller.
- if segue.identifier == "newClassComplete" {
- if let vcSendingToo = segue.destination as? CoursesTableViewController {
- // Pass courseName to nameOfCourses Array
- // Course Name
- let courseName = courseNameTextField.text!
- vcSendingToo.nameOfCourse = courseName
- vcSendingToo.nameOfCourses.append(vcSendingToo.nameOfCourse)
- }
- class CoursesTableViewController: UITableViewController {
- var nameOfCourses = [String]()
- var nameOfCourse = ""
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement