Failed to create Foundation module with Objective-C class in Swift

I am trying to compile a Swift application with additional Objective-C files loaded via the bridge header. However, it gets to the first line:

#import <Foundation/Foundation.h>

      

and shows the error:

Could not build the module 'Foundation'

      

I have verified that the Foundation framework is included but no luck. I've tried various combinations of deployment targets, architecture, etc. Has anyone else experienced this in Xcode 6 beta 5?

+3


source to share


2 answers


Doc says

Any Objective-C framework (or C library) available as a module can be imported directly into Swift. This includes all Objective-C system frameworks such as Foundation, UIKit and SpriteKit



so you can just do

import Foundation

      

+1


source


You cannot import Obj-C-headers into C-Files. (If you are using c in your project).



0


source







All Articles