Bitrise Banner

Editorial: I personally use Bitrise

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

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.

Screenshot of Xcode 4 10 18 12 04 53 PM

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

Screenshot of Xcode 4 10 18 12 05 19 PM

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