This week, Jordan Zucker, iOS maestro at PubNub, shows us just how simple it is to get PubNub up and running in a brand-new iOS project using CocoaPods. Here’s the rundown:
Download the iOS Getting Started Git Repository from the video
CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects that makes it super easy to add and update 3rd party libraries in iOS projects. This is by far the best way to load PubNub’s iOS SDK.
Without CocoaPods, adding a 3rd party library to an iOS project can take up to 40 minutes, assuming you know what you’re doing. CocoaPods cuts this down to only 2-3 minutes, so you can spend that time doing something more productive, like building your cool app.
There’s not a whole lot to it, really. Just a few simple steps:
pod install
from command line within project repository#import <PubNub/PubNub.h>
@property (nonatomic, strong) PubNub *client;
PNObjectEventListener
protocol to ViewController.mself.client
instance variable- (void)client:(PubNub *)client didReceiveMessage:(PNMessageResult *)message
callbackThis is only a simple walkthrough that shows you how to get PubNub up and running with a simple publish-subscribe function. For more in-depth information, visit our docs page for the PubNub iOS SDK. Happy coding!
There are common underlying technologies for a dating app, and in this post, we’ll talk about the major technologies and designs...
Michael Carroll
How to use geohashing, JavaScript, Google Maps API, and BART API to build a real-time public transit schedule app.
Michael Carroll
How to track and stream real-time vehicle location on a live-updating map using EON, JavaScript, and the Mapbox API.
Michael Carroll