Specifying the Module in "Starting the Photorama Application" in Xcode 10.2.1

After following the book’s instructions up through URLSession, I found that I was getting error “Unknown class PhotosViewController in Interface Builder file.” and “Could not cast value of type UIViewController … to ‘Photorama.PhotosViewController’ …”

Checked StackOverflow. Applied the wisdom in https://stackoverflow.com/questions/31440964/cant-cast-value-of-type-uiviewcontroller-to-patterndetailviewcontroller

Specifying the Module in addition to the Class under Custom Class in the Identity inspector eliminated the errors.

@putahcreek, I wonder why my version works as described in the book’s instruction? It would be nice to know why. I find these nuances with UIKit frustrating as I try to learn and understand iOS programming techniques. As an aside, I happen to be simultaneously going through this book and also working on tutorials for the new SwiftUI (currently in Xcode beta). It looks like SwiftUI will eliminate many of these sorts of details. No more UIViewControllers! No more Main.storyboard’s!

BTW: My best to the ducks in Putah Creek…nice town, nice school!

@putahcreek can you let me know what version of Xcode you are using?

Sure thing. I was using Xcode 10.2.1.

If you look at the build phases of your project and look into the “compiled sources” section. Look at the path for the PhotosViewController.swift. Curious if that path is doing something weird similar to an Xcode 11 bug.