1

I have an Objective C project that I added a swift file to - the swift file will contain convenience functions to the rest of my objc project. Adding the swift file triggered adding a bridging header - which I did. All of this works. I also have cocoapods configured and working from objc.

I can call a swift method from objc but my swift file cannot see any of my swift cocoapod modules. I get error 'no such module'. I've searched here extensively and have cleaned my project, cleaned the build folder checked my search paths- all appears ok. I am using use_frameworks! In my pod file.

Any pointers?

user1542125
  • 593
  • 6
  • 16

1 Answers1

1

You need to add your pod header to your bridging header as described here: Import Objective-C Framework (CocoaPod) into Swift?

Community
  • 1
  • 1
Ralfonso
  • 1,614
  • 15
  • 30
  • I may not have been clear but the Cocoapod framework is a swift framework, not Objective-C. When I do import SwiftChart in my swift file I get 'no such module' – user1542125 Oct 18 '16 at 09:24
  • Are you opening the workspace instead of the project? Strange that you can see a Swift module from Obj-C at all - it doesn't work going that direction, only C/Obj-C to Swift. – Ralfonso Oct 18 '16 at 13:22