Insights

We Now Officially Support Swift and Mac OS X

2 min read Michael Carroll on Nov 20, 2015

The hyper-intelligent pan-dimensional mice who write our SDKs just meeped me (a meep is the telepathic equivalent of a tweet) to remind you that our iOS SDK now supports Swift. Technically the SDK has worked with Swift for a while but we didn’t blog about it … until now. If you use CocoaPods (and really, why wouldn’t you) then you can install the PubNub SDK in three easy steps.

Step one: Add the module to your Podfile and install it with pod install.

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
pod "PubNub", "~> 4.0"

Step Two: Import the module in your code.

import PubNub

Step Three: There is no step three. Just enjoy some Swifty goodness.

Oh, and there’s one more thing.

The PubNub SDK supports now Mac OS X too! Even better, you don’t have to do anything special to get it. Add the same Podfile to your Mac Xcode project and import the module. The SDK will automatically adapt to your target platform.

Technically the SDK has supported Mac for a while, but until now we didn’t have the unit and integration tests written. Since we believe testing leads to high quality software we didn’t want to advertise Mac support until we knew it works properly. Now we know, and knowing is half the battle. (The other half is shooting lasers)

You can read the update Swift docs and install it with Cocoapods. If, for some crazy reason, you can’t use Cocoapods we also provide the complete source on GitHub with a variety of ways to build it. Code on!

Now if you’ll excuse me, I have to go find some pan-dimensional cheese.

0