Under The BridgeUnder The Bridge

Safe Page Curl

If you want your app to have a page flip like Apple does in iBooks, the short answer is: No, you can’t do that, because Apple cheats and uses private APIs, as dissected here:

Apple’s iBooks Dynamic Page Curl

… but the long answer, if you really really want to have a page flip kinda-sorta like that, can be found here:

App Store-safe Page Curl animations

It’s a discussion of the Leaves project to fake the iBooks curl in an App Store-safe fashion, forked to twopages branch to extend to side by side pages.

This all looks like quite a bit of trouble to go to, but hey if you really really want it, there’s a start!

Ride Buddy beta

Public service announcement time: So, you ever had a problem missing your stop on public transit? Well, apparently the good folk that we worked with in previous incarnations and have now reconstituted themselves as the intriguingly-named 14 Oranges do … or at least they think you might … because as their debut iPhone product they’ve decided there should be an app for that:


Ride Buddy is a simple iPhone app that helps you make sure you never miss another bus or train stop again. If you are travelling in a unfamiliar city, onboard a bus where the foggy windows make it hard to tell where you are, on a crowded train, or simply wanting to sleep on your way to work, Ride Buddy can help you make sure you don’t miss your stop.

Yeah, we could actually have used that on our Japan/Korea trip last winter, since once you get away from the Shinkansen unilingual navigation is … challenging. Particularly, we remember with a mild shudder, in Nagasaki. But that’s another story altogether…

Any-ways, if this sounds like something you could use, the beta is now open,

We are now accepting names for the Ride Buddy Beta app which will be coming out soon. To qualify, you need to ride public transit (bus, subway, train, metro, monorail, ferry) on a frequent basis and have an iPhone 3G, 3GS, or if you are lucky 4 and using iPhone OS 3.0 or higher. If you are interested, e-mail us at support@14oranges.com, with your name, where you live (City and Country), and also let us know what type of transit you will be using.

so sign up, and spread the word!

WWDC Videos

Now this is a pleasant surprise indeed; WWDC 2010 videos are up already,

Developer Video Archive

… and they’re free through iTunes …

… even if you didn’t attend.

That’s the first time that’s ever happened, we believe. So there you go everybody, it’s SHOWTIME!

h/t: @jeff_lamarche!

… and while we’re on the subject of development videos available through iTunes for free, you might also want to check out on iTunes U 35 hours of

Advanced iPhone Development course from Madison Area Technical College

cocos2d vs. iPhone 4

So you get this email first thing this morning about your latest game:

I am attaching updated images for <REDACTED> (images for iPhone 4 are added)

Oh, snap. So how much work will it be to get cocos2d, which of course this is written with, to be iPhone 4 savvy?

Well, not too darn much, as of … today! From the man himself:

You need to initialize the EAGLView manually. This is a new feature of v0.99.4-beta.


// Create an EAGLView with a RGB8 color buffer, and a depth buffer of 24-bits

EAGLView *glView = [EAGLView viewWithFrame:[window bounds]




// Then call the following methods

[glView <REDACTED>:2]; // a)

[director <REDACTED>:2]; // b)

Once SDK 4.0 is out of beta (no NDA), the “a)” won’t be needed since it will be called from the director.

(The “<REDACTED>” method name is fairly self-evident if you do, indeed, have the NDA-covered SDK.)

Excellent, excellent. And we got that response in eight minutes flat. No, seriously, eight minutes flat.

Just in case we haven’t mentioned this recently enough, if you’re using cocos2d, you really ought to support its development, as a decent open source graphics engine is pretty rare, and a decent open source graphics engine that’s constantly updated and supported with the speed of hummingbirds on meth, well that’s just completely unheard of. We bought both the Sapus Tongue source and the LevelSVG editor, and so should you!

Safari Extensions

So you’ve probably heard that now you can build Safari extensions, and Safari’s got its own Dev Center and certification process and all. Quite the effort they’re putting behind this, isn’t it? Almost as if they have bigger plans to come, or something. In the meantime, here’s a few links that are keeping track of the first attempts at extension building until the official gallery opens:

Safari Extensions (safariextensions.tumblr.com)



Great, as usual, Ars Technica article on developing Safari extensions!

RegexKitLite PANIC!

You remember way waaaaaay back when we mentioned that RegexKitLite looked like pretty awesome stuff for your iPhone app’s regular expression needs?

Well, we hope you didn’t actually listen to us, or you have a problem now, apparently:

Bad News, Everyone! — Professor Farnsworth

I’ve received nearly half a dozen reports that iOS4 applications using RegexKitLite are now being rejected when they are submitted for AppStore approval due to violating section 3.3.1.

I don’t wish to speculate publicly as to why at this point due to the fact that iOS 4 is still under NDA. Needless to say, if you application uses RegexKitLite, you should prepare for the fact that it will likely be rejected at this point.


The Sourceforge project page has some discussion of this as a potential issue (search for “The iPhone 4.0 SDK Agreement”) and available alternatives (search for “iPhone OS ≥ 3.2”, so if this is an issue for your about to be submitted app, we suggest you start there. Good luck with that!

Introduction to NEON

So if you have any need for hardcore DSP-type stuff in your iPhone app, and you don’t already know all about the ARM® NEON™ engine, here is the article for you:

Introduction to NEON on iPhone

A sometimes overlooked addition to the iPhone platform that debuted with the iPhone 3GS is the presence of an SIMD engine called NEON. Just like AltiVec for PowerPC and MMX/SSE for x86, this allows multiple computations to be performed at once on ARM, giving an important speedup to some algorithms, on condition that the developer specifically codes for it.

Given that, among the iPhone OS devices, only the iPhone 3GS and the third-gen iPod Touch featured NEON up until recently, it typically wasn’t worth the effort to work on a NEON optimization, given that it would benefit only these devices, unless the application could require running on one of them (e.g. because its purpose is to processes videos recorded by the iPhone 3GS). However, with the arrival of the iPad it makes much more sense to develop NEON optimizations. In this post I’ll try to give you a primer on NEON…

Good stuff, good stuff. Now, for most of us, no doubt the Accelerate framework publicly announced for OS 4.0 is going to cover most everything we’re going to have any probable use for, but hey, if you’re really hardcore … this is what you need!


If you’ve done any work with the Keychain, you’ve no doubt noticed that it’s not the most elegant of APIs. Here is EMKeychain to fix that for you:

EMKeychain is a Cocoa wrapper class for Keychain, which has unfortunately been frozen in carbonite. It’s much cleaner than interfacing with keychain yourself, is actively used in commercial-grade products, and is completely documented.

Haven’t tried it ourselves just yet, but hey it seems like nice work!

BDD Testing: Cedar

So let’s say you’re interested in Behaviour-Driven Development testing of your iPhone projects. But there isn’t anything to help out Objective-C like all the cool kids have, you say? Not so! Here is your introduction to Cedar:

BDD-style testing using Objective-C

… One of the things I found I miss most in testing Objective-C, Java, or C++, is the hierarchical structure for organizing tests that frameworks like RSpec or Jasmine provide. I find nested describes indispensable for managing orthogonal aspects of the classes under test, for handling preconditions, for eliminating redundant setup code, and for generally keeping my sanity. So, when I first heard about the addition of blocks in the GCC compiler for Objective-C the first application that came to mind was testing.

So, I wrote Cedar, a BDD-style framework for writing tests in Objective-C. The code is available here. Perhaps more importantly, Cedar is in its infancy so I’m interested in any suggestions and feedback. To that end, I created a public Tracker project for it here

and a followup post correcting people who thought it wouldn’t work for iPhone development:

BDD-style testing for iPhone projects

… I actually wrote Cedar specifically for testing iPhone OS projects we’re working on at Pivotal. To prove it, I’ve started a small public iPhone project that I’ve test-driven entirely with Cedar…

So that looks like that might be an interesting new development style to take up. Although, at this exact point in time, one might wait for that currently-NDA’d version of Xcode to be released before making any firm commitments…

h/t: iPhoneFlow!