Example app using MapKit and instagram media search api
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CercaPix.xcodeproj
CercaPix
CercaPixTests
doc
Default@2x.png
IMG_6318.PNG
IMG_6321.PNG
IMG_6323.PNG
readme.md

readme.md

CercaPix (NearPix)

Find Instagram photos near me

README

This sample app retrieves a list of images within a search radius around the user's location, using the Instagram media search api. The results are displayed on a map, which you can then touch to view the photos in a separate view controller. If there is a map annotation selected, some details about the photo are shown. Swipe left and right on a photo (in detail mode) to page through the photos. Tap the detail photo to return to the grid view of the list.

Screenshots

map

detail


The app tries to lazy-load all image assets, using a category on UIImageView which asynchronously downloads an image while setting a placeholder.. It will attempt one retry before giving up, if the image download fails..

The api ingestion method is to serialize the api response as JSON using the built-in json serialzation library, which returns an NSDictionary. Since this app only uses a small portion of the Instagram api, the entries are then retrieved with accessor convenience methods which are added to NSDictionary via a category, NSDictionary+instagram_api. When I started doing that I thought maybe I could use typedefs to hide this better, but you can't write a category on a typedef'd object.

Prerequisites

  • XCode 5.x
  • ios 7.1

Running the app

To use this app set the Instagram Client ID in constants.m You can get one of these by signing up for Instagram and going to their developer pages at http://instagram.com/developer/

In constants.m, update:

     NSString* const kInstagramClientId              = @"YOUR_CLIENT_ID";

After that, load it up in xcode and give it a whirl.

Please file an issue if it doesn't work.

Universal app

This app will run on both iPhone and iPad. (mainly tested on iphone though)

Known issues:

  • There is no network check -- no network means no results, with no error message
  • If the GPS does not have a good fix, the map region zoom level is wonky
  • iPad UI needs work
  • If left running for a long time, images fail to download. This probably has something to do with the not-very-robust ImageView category running out of retries.
  • Sometimes results appear outside of the user-defined search radius. Without getting out my cartography tools, I am guessing this is on instagram's side ;-)