Component editor not showing existing components in .sks editor (Xcode 9.0.1)

I have a SpriteKit project that makes use of the component system provided by GameplayKit.


Historically, this has worked fine. In the .sks editor, I could select a node and the component editor would show the components attached to that node. I could edit properties that are exposed with @GKInspectable, and everything was working. I made quite a few scenes with lots of components for my project.


Today, I opened up my project to make some changes (in 9.0.1), and clicking on the nodes which have components on them, the component panel of the .sks editor remains blank, showing no components.


If I build and run the project, it still behaves as if they are there. So the component definitions appear to be in the .sks files still - just not displayed in the editor.


HOWEVER, if I make a change to the .sks file and save it, though, the changes to the components are wiped out. I can re-add components to the scene, and the new components take effect as expected, but all the components I had defined earlier are gone, and would presumably need to be re-defined.


So I'm stuck. If I touch any of the scenes that have components in them, the components I had already defined are going to be lost. I could, of course, go back into all the scenes and redefine all the components, but I would rather not do this for all the scenes in my project, for obvious tedium and error-prone-ness reasons.


Anyone know what might be causing this, or how to work around it?

Replies

An update for those who stumble upon this issue, too.


It appears that there has been a format change for the .sks files between XCode 8 and 9. If you open up a new and an old .sks file in a text editor (they're just XML plist files under the hood), then you will see that the old versions stored the components with a "SKSceneCustomComponent" whereas the new versions store the components with "GTFSceneCustomComponent". If you do a text search-and-replace "SKSceneCustomComponent" with "GTFSceneCustomComponent" in the plist file for the .sks file, you can start to see the components again in the XCode 9 .sks editor. Not sure whether this would introduce any bad side-effects, though, so use that at your own risk...