Wednesday, September 17, 2014

Cocoapods Support

If you're not aware of Cocoapods for iOS, you should check it out.  It's a dependency management system for source code and it's gotten quite popular.

We now have an up-to-date pod spec for WhirlyGlobe-Maply 2.3.

WhirlyGlobe-Maply Pod


All credit goes to Juan Collas who put together the latest pod (and the old one).  I contributed... absolutely nothing.  Now that's what I call open source!

The pod is named WhirlyGlobe, but Maply is in there too.  If you go looking for it on cocoapods.org you'll see this.


Using the Pod


Pods are pretty easy to use, which is kind of the point.  If you haven't installed the pod gem, go follow their instructions.

I've added a github repo that has the standard test app set up with a Podfile.  To build this, do the following:

  • git clone https://github.com/mousebird/WG-Maply-Pod-Test.git
  • cd WG-Maply-Pod-Test
  • pod install
  • Load WG-Maply-Pod-Test.xcworkspace in Xcode (not the xcodeproj)
  • Build and run

It's that easy.  I'm kind of amazed.

Setting Up Your Own


If you want to set up your own project, include the following in your podfile.

pod 'WhirlyGlobe', '2.3'
pod 'WhirlyGlobeResources'

Consult the Cocoapods site for all the rest of it, or check out the podfile in the example.  If you don't need the resources (e.g. source data), leave out the second one.

That's it.   Thanks again Juan, this is cool!

No comments:

Post a Comment