0

I'm trying to add a Swift file to my app and get a "Failed to import bridging header" error, among others.

Bridging-Header code:

//
//  Use this file to import your target's public headers that you would like to expose to Swift.
//

#import "Menu.h"

enter image description here

enter image description here

Christophe
  • 68,716
  • 7
  • 72
  • 138
raginggoat
  • 3,570
  • 10
  • 48
  • 108

1 Answers1

0

In build settings, try setting "Embedded Content contains Swift Code" to Yes.

Also, it looks like its failing to recognize objects from UIKit, so try adding "import UIKit" atop one of your Swift files.

vikzilla
  • 3,998
  • 6
  • 36
  • 57
  • I set that to Yes and nothing changed. The one Swift file I have is importing UIKit. – raginggoat Feb 11 '15 at 21:06
  • How did you initially add the bridging header? I would suggest removing the current bridging header and doing a Product > Clean. Then going to File > New > File to create a new empty Swift file. It will then prompt you to automatically import a bridging header and select Yes. – vikzilla Feb 11 '15 at 21:09
  • I can't get it to prompt me again. – raginggoat Feb 12 '15 at 12:32
  • In build settings, set Objective-C Bridging Header to nothing and try again. – vikzilla Feb 12 '15 at 16:23