Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. class NewCourseViewController: UIViewController {
  2.  
  3. @IBOutlet weak var courseNameTextField: UITextField!
  4.  
  5.  
  6. override func viewDidLoad() {
  7. super.viewDidLoad()
  8. }
  9.  
  10. override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
  11. // Get the new view controller using segue.destinationViewController.
  12. // Pass the selected object to the new view controller.
  13.  
  14. if segue.identifier == "newClassComplete" {
  15.  
  16. if let vcSendingToo = segue.destination as? CoursesTableViewController {
  17.  
  18. // Pass courseName to nameOfCourses Array
  19.  
  20. // Course Name
  21. let courseName = courseNameTextField.text!
  22. vcSendingToo.nameOfCourse = courseName
  23. vcSendingToo.nameOfCourses.append(vcSendingToo.nameOfCourse)
  24.  
  25.  
  26. }
  27.  
  28.  
  29. class CoursesTableViewController: UITableViewController {
  30.  
  31. var nameOfCourses = [String]()
  32. var nameOfCourse = ""
  33.  
  34.  
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement