Xcode – didMove never get called

didMove never get called in Xcode?

didMove never get called when creating a new project with Xcode using the Game template. I selected Swift and SpriteKit. I found this issue when I was following a course on Udemy.com, and I couldn’t get a simple project to run like in the course videos. Creating a new project after deleting the one I was working on, after trying to debug the error, gave me the same result. didMove never get called. I did only one change to the project created with game template. That was to put in print(“didMove did run”). But it never was.

The only way I would get the didMove to run was calling the scene like this in the GameViewController.
let scene = MainMenuScene(size: CGSize(width: 1536, height: 2048))

Tried to google, and I found this one post on Stack Overflow with the same issue. He said it was caused by a period in his project name. Crazy, but I did use a – in my project name. Was only a test project, so calling it physics-test was not a good idea. I renamed it to PhysicsTest, and the didMove was called.

Not sure if it is a language setting issue or anything. I’m using english language and Norwegian region settings on my computer. Not sure if that got anything to do with it, but in the tutorial video I was following it worked great using – in the project name.

Anyway, if you experience didMove never get called in Xcode, it might be worth removing any non letter and number characters.

Happy coding!

About Author

Related Posts

Xcode 9 iOS icon sizes

Xcode 9 iOS icon sizes overview

Xcode 9 iOS icon sizes overview Xcode 9 iOS icon sizes overview. They keep adding more and more icon sizes. Xcode 9 has the most icon sizes…

Xcode 9 uiimage image not shown

Xcode 9 uiimage image not shown

Xcode 9 uiimage image not shown Working on some ios apps created with Xcode 8 and your images don’t show after upgrading to Xcode 9? Took me awhile…

Xcode 8 iOS icon sizes overview

Xcode 8 iOS icon sizes overview Xcode 8 iOS icon sizes overview. There are even more icon sizes since Xcode 7. And it can be an extra challenging…

Swift Capitalize

Swift Capitalize words, How to

Swift Capitalize, How to Swift Capitalize is done with a string instance property. Check the example below to see how to use it. There is also a link…

Swift Debian

Swift Debian 8 (Jessie)

Swift Debian 8 (Jessie) Swift, Apples new programming language, to take over for Objective C has been open source for some time now. It only took at…

Swift Change UIButton text

Swift Change UIButton text

Swift Change UIButton text How to in Swift change UIButton text?A common mistake, also done by myself some time ago, is to try to change it through…

Leave a Reply