1

First I want to note, I've read this and have used it before and my question is different:
How to call Objective-C code from Swift

I'm trying to use this library in Swift.

This library uses OCMock and when I try to compile, I get 'OCMock/OCMock.h' file not found at the line #import <OCMock/OCMock.h>. Here's how I normally fix it, but this time, it's not working.

Just like every other Obj-C library in Swift, I added it to my bridge header, which I already had made and am using for others:

#import "JSQMessages.h"
#import "JSQMessageData.h"

I then added $(PROJECT_DIR) to my Header Search Paths.

Here is the file structure.

enter image description here

From the project directory, it should look for OCMock/OCMock.h, and it is there, as seen in screenshot. So why isn't it working?

Community
  • 1
  • 1
user83039
  • 3,047
  • 5
  • 19
  • 31

1 Answers1

1

I just created a fresh swift iOS project, add JSQMessage using CocoaPod(http://cocoapods.org). No error. try following:

1. Create a new project

2. Create a podfile and add 

    pod 'JSQMessagesViewController'

3. Create a bridge header and add

     #import <JSQMessagesViewController/JSQMessages.h>    // import all the things

3. Run

    pod install

4. Open project.xcworkspace and build it
Shuo
  • 8,447
  • 4
  • 30
  • 36
  • That didn't work, but I added `pod 'OCMock'` and that worked. Now I'm getting `Use of undeclared identifier UIApplicationDidReceiveMemoryWarningNotification` – user83039 Nov 08 '14 at 18:42