Go, Ruby, and iPhone
3 months ago
Tweet this Bookmark and Share

iPad and iPhone javascript performance

I am working on an HTML5 game that will be embedded in a UIWebView and packaged as a native iPhone app, but was having some performance issues: various divs would be hidden or displayed as the user clicked on certain elements, but there was a noticeable lag with each click. It turns out that the 'click' event in Mobile Safari has quite a delay. I would guess this is to help distinguish it from other non-click gestures like dragging or double clicking. Thankfully there is another way. The "'touchstart' and 'touchend'":http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/handlingevents/handlingevents.html events are sent to your app in a *much* more timely fashion.

blog comments powered by Disqus

I'm a software engineer enjoying work in both Ruby & Rails and the iPhone platform. I've published a couple of iPhone apps now: Spectrogram and CricketSong, and have a couple more in the pipeline.

Creative Commons License

All content on this blog is available under the Creative Commons Attribution 3.0 License. littleblueplanet.net is running Kakuteru a new Semantic-Web enabled lifestreamer. Design and interaction inspired by Yonfook's Sweetcron. Most icons used are by Joseph North.