Disaster

This just happened out of no-where!
As it so happens I have now written my first bug report to Apple...


1 day later...

I don't know how this happened but I was able to resolve this by adding:

#import <UIKit/UIKit.h>

To the top of this file that was having the problems - this is the Swift.h file I can't even see in the directory explorer so I don't know why this statement was missing...

I haven't seen this problem anywhere else on the net so if you did get hit with this one, hopefully this solves your problem!

Resolution


2 hours later...

Well the problem is still there! I need to keep re-adding: #import to the Swift.h file - really annoying because the file gets regenerated on clean I believe.

Bug report updated!


1 hour later...

Ok I found the issue!

modules

I noticed this if statement around the UIKit import statement and remembered that I disabled modules!

Here is the setting in build settings - just change it to yes and it all works great!

build settings

OMG - as usual, the problem comes back to me!
I have to assume that this setting is meant to remove all Objective-C elements from the project (i.e: the UI kit)

Still interested to see the results of the bug report...