+ 4

Anyone else have trouble with building the "First iOS app" in the Swift course?

I got as far as the "Implementing Navigation" unit under "Your First iOS app," but I had to add a second navigation controller in order to add the title and buttons to the navigation bar in the second window...I'm not sure if that's causing all of my problems... But the real issue is in the "Adding Items" unit. The code the course tells you to copy doesn't seem to work in the latest version of Xcode. I've tried what others have posted in the comments, but those comments are months old... Anyone know what could've gone wrong? It's these two strings of code in the ItemTableViewController.swift that are causing all the ruckus: override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if sender as AnyObject? === saveButton { let name = nameTextField.text ?? "" item = Item(name: name) } } @IBAction func unwindtoList(sender: UIStoryboardSegue){ let srcViewCon = sender.source as? ViewController let item = srcViewCon?.item if (srcViewCon != nil && item?.name != ""){ //Add a new item let newIndexPath = NSIndexPath(row: items.count, section: 0) items.append(item!) tableView.insertRows(at: [newIndexPath as IndexPath], with: UITableViewRowAnimation.bottom) } } Thanks for any and all feedback.

19th Oct 2018, 12:36 PM
Michael Haase
Michael Haase - avatar
1 Antwort
+ 3
I've never tried.
16th Apr 2019, 11:40 AM
Sonic
Sonic - avatar