How to Import iOS Modules with Spaces in the Name for Testing


  • Share on Pinterest

So here’s a little tip that took me longer to figure out than it probably should have. I want to start getting better at testing my Swift code, I decided to start creating some tests for my Code Notes application.

The problem, the Xcode application is called ‘Code Notes’. Yes there is a space in the name. For the observant, you cannot import a name with a space.

So the solution is simpler than you might think, replace the space(s) with an underscore.

Problem solved.

I hope this saves you some time banging your head against a testing wall.