I am building a new document-based application in Swift for OS X using Xcode. I would like the default Document class to be called something that is not Document (in this case Notebook), though of course it would still subclass NSDocument (or NSPersistentDocument if I use Core Data). I can rename its file from Document.swift to Notebook.swift, but once I rename the actual class from Document to Notebook, running the application pops up the error alert "No document could be created." The console tells me "The DocumentType type doesn't map to any NSDocumentClass."
So, obviously I have to do other things to make the document architecture recognize my class once I have renamed it. But what? I found some directions on another site but they are old and written for Objective-C and XIB when I am using Swift and storyboards; what I need to do is likely to be quite different. What does one need to do to rename the main document class for a document-based application, in Swift, using storyboards?
EDIT: There was a request below for code. Basically, the default Document.swift or Notebook.swift file looks like
import Cocoa
class Document: NSDocument {
... [standard code for Document class goes here, edited out for brevity]
}
and I changed it to
import Cocoa
class Notebook: NSDocument {
[...]
}
It worked with the version on the top and does not work with the version on the bottom.