Tapku

Archive for the ‘album shuffle’ Category

Quick Interactive iPhone App Mockup: Briefs

Saturday, October 3rd, 2009

Briefs, released recently at the C4 developer conference, allows iPhone developers to quickly  assemble interactive iPhone mockups through images. While the application is still rough around the edges (I couldn’t figure out how to import non-bundled briefs among other things), it functions in allowing developers and designers to “create” the application before actually coding. To use the Briefs, you’ll need a few screenshot of your application and a plist file with a .brieflist extension. Essentially in this plist file, you’re pointing to the various image screens, and putting touch areas on the screen to transition to another page. The project comes with an example brieflist to follow. Just make sure when you import screenshots and brieflists, you set the target to the actual Brief target and not the BriefCompactor. The library is located on github here.

Using Geometry to Create 2D Physics Motion of A Flicking Gesture on the iPhone

Monday, August 24th, 2009

In Album Shuffle, you can move and flick albums across the screen. After a user ends a touch event by taking their finger off the screen, the album will still move across the screen as if it were a real physical environment. This article will focus on figuring out how to move the object in a semi-realistic way after the touch event ends. To figure out the velocity of just how fast the object is moving, we’ll need to brush up on some old geometry, which the article will cover. You can take a look at the code used to calculate the motion.

Recording touch information

When a user touches the screen, the view that receives that touch event through the touchesMoved function. The key to figuring out the velocity of the touch is based on how often this function is called. The touchesMoved function isn’t called after the touch moved every pixel, instead the function is called based more or less on time. (Note: if a user touches the screen and doesn’t move their finger, the function won’t be called either because the touch event didn’t move, hence the name touchesMoved. ) If a user touched across a large area of the screen very quickly, then the touchesMoved function might be called two or three times. If that same touch movement was done slowly, then the touchesMoved function might be called 20 or 30 times. The key is that each time an event is sent, the new coordinates are sent. So by remembering the last two touch events sent through the touchesMoved function, based on the gap between these two coordinates, a velocity can be determined.

Geometry Time

So after a touch event occurs, the touchesEnded function is called on the view. At this point, its time to use the last two touch points given to figure out the velocity. Here is where the good old geometry math will help, the distance between these two points is

Distance Between Two Points Formula

Distance Between Two Points Formula

The higher this number, the faster and further you need to animate the object across the screen (You’ll need to divide this number by some constant so the object animates proportionate to the motion). The direction can be figured out based on these two points as well. When animating, the time of an animation can be held constant because an object that needs to travel further will travel faster to a spot because it needs to travel a farther distance in a shorter time.

Faster Animation on an iPhone: Quartz vs Core Animation

Saturday, August 22nd, 2009

Article moved to: http://devinsheaven.com/faster-animation-on-an-iphone-quartz-vs-core-animation/

Album Shuffle is Ready

Friday, August 21st, 2009

Album Shuffle Ready For Sale

After months of frustration built up from the approval wait, I’m happy to announce the approval of Album Shuffle. The application is a free, little interactive application that allows you to experience your music albums in the iPhone’s multi-touch environment. Go ahead and download it. Enjoy!
I wrote previously on the doubts that surmounted from the extended approval time. So much so, that I doubted that Album Shuffle would ever be approved into the App Store. I still stand by my intuition that any application that takes advantage of the Music API in iPhone OS 3 will be ushered into an extend approval time queue though. All that aside, I’ve written a few articles discussing the various issues that Album Shuffle presented when developing an application that deals with multi-touch and layer transparencies with the iPhone. Stay tuned for those articles!