Thursday, August 28, 2014

Playground has never been so fun

Since Xcode6 beta first launch in June 2014 at WWDC, its most popular and fun feature has always been Playground - or at least for me :]
Imagine the fun to be able to run code snippets, have them executed in a glimpse and all that for a type safe compiled language like Swift. This sounds like the panacea of quick prototyping and Nirvarna to Swift newbies.

Off course, along the beta path, I learned the few caveats and things you can't do with Playgrounds. There are a few issues and limitations. Crashing Xcode betaX is more likely with Playgrounds. Some weird issues like string interpolation not working in Playground, or difficult stuff like how to do asynchronous call etc... But my enthusiast toward Playground is still intact.

Since I read in Swift forum (a great place to learn btw), with Xcode6 beta 5, it is possible to import your own library within a playground sheet. All you need to do is have them (framework and playground) bundled together in a workspace. How cool!

I've tested it on aerogear-ios-http, see the PR here. All you need to do:

Step 1. Create an iOS Framework & library project... or use an existing one

Step 2. Save as workspace

Step 3. Add playground file

Step 4. Build and run test for your framework using 64bits simulator (iPhone5S)

Step 5. import your module in playground and demo your API usage

I found this is ideal to quickly show case how to use a library et let the developer plays with it.

Happy Swifting!

Tuesday, August 26, 2014

AeroGear, iOS8 and Swift: Push happiness forward!

AeroGear iOS Push lib 1.0.0 , out this August, features iOS8 support and (in its preview) even offers a 'Swift' branch with the lib being rewritten "The Swift Way". Ready before the official iOS8 release, we hope you will enjoy it as much as we did :)

AeroGear Push notification on iOS8

AeroGear UnifiedPush Server is ready with updated payload. What does it mean for your app?
  • You can send longer messages.
  • You can use interactive notification.
  • If you want to dig deeper into interactive notifications please follow iOS8 interactive notification available in AeroGear with a step by step tutorial and videos.

    Get ready: Switch to Swift

    Getting ready before the iOS8 release got its price. It means some efforts to keep our demos and libraries up to the latest beta version and of course as it's beta, it takes some radars filling and workarounds. Currently all our Swift code compile against the latest Xcode6 beta6 (out the 18th August). Some workarounds are needed specially around framework build. I recommend you follow that mailing list thread for more details.

    Give Swift Push lib and demos a trial

    If you're all set up (latest Xcode6 and iOS8 device), give a spin to our HelloWorld Swift demo, you can use the OpenShift admin console to push messages. If you want to delve into more complete app, try our full blown server side and client side demo app Contact in its Swift branch.

    Going further into Swift

    AeroGear iOS team has chosen to go Swift first for the next releases.
    You can check out our roadmap and you'll see most of the upcoming tickets are Swift based ;)
    We've just baked aerogear-ios-httpstub, you can read more about its insights in my previous blog post. We're working on aerogear-ios-http a lightweight layer to take care of your http requests and our OAuth2 module is on its way.

    ... Ready?
    Switch to Swift?