Making Your Salesforce iOS SDK Apps Work on XCode 8/ iOS 10

iPhone-6-iOS-10-UpdateIt’s the most exciting time of the year for any Apple developers (iOS/ watchOS/ macOS/ tvOS) – it’s WWDC 2016. Apple just released the Developer Preview for XCode 8 which lets you build and test your apps for iOS 10 – the next major version that will be released this fall.

The first thing I tried after downloading XCode 8 was to see how nicely (or how badly) the Salesforce iOS SDK will play with it.

The first thing you should remember is that XCode 8 is a beta – don’t expect it to be perfect. Each XCode release typically has a few developer previews before it goes live.

Screen Shot 2016-06-16 at 1.00.05 PM

On the positive side, it seems reasonably stable for me – just a couple of crashes in the last 72 hours or so is a very promising sign.

The best way to verify how Mobile SDK will play with XCode 8/ iOS 10 is to take up one of the sample apps shipped with the SDK and try to make it work. I picked the RestApiExplorer  sample app.

Building Salesforce1 iOS SDK for iOS 10

If you try to build the SDK for iOS10, you’ll probably run into the same issue I did. The earlier version use tons of

objc_unretainedPointer

On the other hand, XCode 10 recommends using

(__bridge void*)(self)

Go ahead and do a search replace on the above strings & your Salesforce iOS SDK is built successfully for iOS 10/ XCode 8 – bingo!

If you prefer not to do this yourself, you can just checkout the unstable branch of the SDK using the steps mentioned below.

git clone https://github.com/forcedotcom/SalesforceMobileSDK-iOS.git

git checkout unstable

Once this is done, it really comes down to making your own app code compatible with XCode 8/ iOS 10. A good starting point for that is to use the provided Swift Migration Assistant.

And make sure to set your project deployment target to iOS 10 as shown here.

Screen Shot 2016-06-16 at 1.14.09 PMOf course, some of the biggest challenges I’ve seen so far is that my apps using SmartStore and SmartSync frameworks don’t seem to be working as expected and need some tweaks.

However, for any simple apps doing CRUD operations in an online mode, this should be sufficient to get you started for the XCode 8/ iOS 10 journey.

I hope to do more tutorials as I dive deeper into XCode 10/ iOS 10 in the weeks to come. Till then, happy coding!

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s