sample code from https://github.com/heroku/devcenter-ios-geophoto-api