Recently I’ve found myself working with iOS 8 extensions, building Today widgets for Notification Centre using Swift. More specifically, I was attempting to build a widget in Swift for an app built in Objective-C. All was good until I went to run on device, when I received the following error message on the console:
What I hadn’t noticed was a build setting titled ‘Embedded Content Contains Swift Code’ which by default is set to NO. Flipping this solved the problem, though it’s interesting to note that for projects built in Swift, you can add Swift extensions, leave this setting at NO and run your extensions just fine on device.