Additional Reference: PubNub Github Repo README Instructions
Important Notes
Make sure that your iOS project (.xcodeproj) is within a Xcode Workspace (.xcworkspace). Being in a workspace rather than a project changes Xcode behavior when drag-dropping files.
If you are only in an .xcodeproj, then it doesn't prompt you with options to "copy items if needed" and automatically creates symlink rather than copy files into project (hence being susceptible to the changes in the original PubNub project).
- File ... New > ... Workspace ( ^⌘N )
- You can right click and click on New Project...
- If you already have an iOS Project, you can create a workspace in same folder and add the project by clicking on left side and Add files to Project
- Destination: Check Copy items into destination group's folder (if needed)
- Folders: Select Create folder references for any added folders
- Download/Clone PubNub iOS SDK in a separate folder from your workspace/project Github Repo
- You can either add the PubNub project to your workspace, OR, just open the PubNub .xcodeproj and build it
- In either case, you will generate files in the Products subfolder:
- libPubNub.a
- PubNub.bundle
- From built PubNub SDK Products subfolder, Right click on libPubNub.a and click "Show in Finder"
- Create folder in Frameworks
- In Finder, Highlight PubNub.Framework and PubNub.bundle
- Copy the files over into your iOS Project in the Frameworks folder
- Add a new .h (header) file to iOS project, I named it BridgeHeader.h
- Add import statement
#ifndef manual_test_BridgeHeader_h
#define manual_test_BridgeHeader_h
#import <Pubnub/PNImports.h>
#endif
- Click on Project Name, select Build Settings, Search for "Bridging"
- Click on blank space to right of Objective-C Bridging Header
- Type full path to BridgeHeader.h