An Internet of things

Musings on iOS and PHP development, IOT and other bits and pieces

Automatically create your iOS Icon.png files with a simple bash script

I was recently made aware of the very handy sips(1) command line tool. Sips is short for Scriptable Image Processing System; it is more or less a command line front end to some of Apple’s processing abilities.

My problem that day was How can I automatically resize my Icon.png artwork and all of a sudden with the knowledge of sips’ existence it was easy to write a small bash script to rename and resize my large 512x512 pixel artwork down to the various names and sizes required by iOS. (Thanks Mark!)

The script is simple. Give it an input PNG image at least 1024x1024 pixels and it will create your Icon.png and derivatives nicely. The sizes required at any one time are all outlined in the Application Icons section of the iOS Application Programming Guide.

This script should save you at least a dollar on the similar GUI apps on the app store that do the same thing..

Checkout the gist

Update 2013 updated with new image sizes.

Integrating Apple iAds - Melbourne CocoaHeads November 2010

I’m presenting a talk tonight at Melbourne CocoaHeads on implementing Apple’s iAd framework. I’ll be going over how to add the iAd framework to your project, a handful of things to remember about using iAds and an overview my first hand experiences with Seoul City Metro as an iAd supported app.

I will be showing some code I have recently sourced a named JCAdSupportedNavController that provides a good way to implement iAds in a UINavigationController. You can check it out on github.

The sides for the presentation are up on slideshare

Attending: TEDxCanberra 2010

Just a heads up that I will be attending TEDx Canberra this weekend! After forgetting to signup properly to TEDx Sydney I’m looking forward to a great day!

A photo of me yawning in the background

Recent iOS version statistics from Delhi City Metro

Not long after iOS 4.0 was released I pushed a small update to Delhi City Metro to keep track of some basic (anonymous) user statistics. I’m keen to gauge the audience of any specific iOS 4 features I might consider adding and now that I’ve been able to visualise these, I thought I’d share them here.

To add a geographic angle to the iOS usage statistics you can see in the second graph that the majority of Delhi City Metro users are from India.

iOS 4 take up rate

Several weeks after the launch of iOS4 the split between iOS 4 and iOS 3 is 4.x 64% and 3.1.x 31% with iOS 3.2 at 4%. (statistics from 13-26/8/2010)

Geographic sales for Delhi City Metro

Adding a 'pull to refresh' control to a UITableView

Today I was tooling around with some interface concepts and playing with apps like foursquare and Twitter (previously Tweetie) and I wondered if I could implement something similar to the now famous ‘pull down to refresh’ method of initialising a refresh of the content within a UITableView.

As it turns out it wasn’t as difficult as I thought; There were already a couple of elegant solutions out and about. The first example I found was by Oliver Dropnik, which talked about altering an existing solution posted on git hub by user devindoty called EGOTablePullViewRefresh.

Oliver’s code looked like it was a good addition to devindoty’s because he had decided to subclass UITableViewController which leads to a much more complete solution that’s easier to move between projects. My only issue with Oliver’s code was that it refactored a lot of the underlying implementation, where I didn’t see too much wrong with it.

I decided to come up with a half way measure. I moved the majority of the grunt work into a subclass of UITableViewController, cleaned up the Xcode demo project included with the source code and pushed it all back up to github. If you’re at at all interested in this, I’d suggest checking out my fork of the EGOTablePullViewRefresh project.

pull-to-refresh effect like Tweetie 2 and foursuare

Update 23/2/2013: Apple has implemented this functionality in iOS 6 with UIRefreshControl, I would use that instead.