1
votes

This question has been asked before but I can't see any cause relevant to my issue.

I've created a very simple view controller and trying to load it but getting an unknown class MapViewController in interface builder file error. Here are some relevant parts:

class MapViewController: UIViewController {
    ...
}

...
let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let  mapViewController = storyboard.instantiateViewControllerWithIdentifier("MapViewControllerID") as MapViewController

enter image description here

  • The MapViewController.swift file is included in the Compile Sources.
  • The storyboard has the default name of Main.storyboard
  • Have exited Xcode, rebuilt, deleted the app on the device.

The problem still persists, any suggestions?

(Using Xcode beta 4)

2
This would be way easier for us to diagnose and fix if you created an example project on Github that we could run and test ourselves. - drewag
Double check the module name (I know it's supposed to be picked up automatically but recently another person had similar issues) - Alladinian

2 Answers

0
votes

My problem was I had accidentally selected a module under the class entry for custom class in IB. Once I deselected that everything worked.

-1
votes

How I solved this was to 1) Delete the derived data 2) Rename the class to MyMapViewController 3) Delete derived data again 4) Rename the class back to MapViewController