Chapter 10 - scene editor not recognizing custom class?

I’m sure I’ve got everything setup correctly but, Xcode doesn’t recognize the custom BedNode class. There are no errors. I can enumerate all of the nodes. I tried adding initializers to the BedNode class, these don’t seem to get called, and the enumeration loop doesn’t recognize

customNode = node as? CustomNodeEvents.

I tried adding the name of my project in front to the class name in the custom class field. Something like

Chap2.BedNode

If anyone else has the problem this solution worked for me:

I had the same problem of the custom BedNode class not being recognized and Xcode just treating it as a generic SKSpriteNode instead. Finally, after much searching through my code I found out that I made a very simple and stupid but easy to overlook mistake. Turns out in my case that the reason that my BedNode.swift file and the BedNode class defined in it was not recognized by Xcode was because I was writing the start of the class definition as “class bedNode” instead of “class BedNode”. Doh!