Speaker Alert: A few tweaks

After last weekend's quick application challenge, I've come back to Speaker Alert and made a few tweaks before some serious testing at the Phoenix Speakers XMas dinner next week.

There were a few things I didn't quite get round to over the weekend's rapid development, so I was eager to fix a few things, and a quick chat with Alex (our PR and Events bod) brought up a few great ideas for improvements. After a rather hectic week, I managed to catch a few hours today, and gave myself the goal of adding:

  • Background alerts (at least a vibration)
  • Flashing alert after the Red light
  • Option to hide the elapsed time on the timing screen
  • Autorotation on the timing screen

The background stuff was easy, thanks to the inclusion of Local Notifications in iOS 4.0. If Speaker Alert is put into the background while timing (whether via the Home Button, Lock Screen or however), alerts will be raised for each light change. Getting vibration alerts does, however, require a sound associated with the alert. This means Speaker Alert should really be run in silent mode when delivering a speech. But then again, you'd be doing that anyway. Wouldn't want your phone going off during a speech, would you?

Hiding the elapsed time was even easier, being a simple boolean setting along the same lines as vibration alerts. And the flashing alert was a simple matter of starting an NSTimer to toggle the screen colour every half second (and vibrate as required).

Of course, all these extra options left the Overview screen looking a bit crowded:

So I moved the "Vibrating Alerts" and "Display Time" options to the iOS Settings pages. The SharedConfig class I wrote last weekend was a bit of a kludge for time, so I spent some time today looking at the handy NSUserDefaults class, the proper way to do simple config options. This let me do away with SharedConfig entirely, and cleaned up the Overview screen nicely.

 

Finally, autorotation, which was just a case of enabling rotation of the timing page, and fixing up autosizing and positioning for the relevant UI elements. This is a little cryptic in the interface, so for anyone who wants to handle Landscape and Portrait layouts properly in Interface Builder, I found a great couple of tutorials:

With these extra options and such, it also seemed like a good chance to do a bit of refactoring and make sure I was doing everything properly. Full, up-to-date source is still available on GitHub.

I think I can call that a Release Candidate. Now to try it out in anger!