A quick tutorial for adding the coverflow effect to your project, it’s a really useful/cool effect for any kind of app. (In fact you’ll be able to add lots of cool UI from the Tapku library, but i’m just focusing on the Coverflow effect for this tutorial).
At the end of this tutorial you’ll end up with something like this
Here i’ve called the project ‘Coverflow’ for this example
I generally like to copy the Tapku library into my project, so open your project using Finder and copy the ‘src’ folder into your project folder. In this example I also create a folder called ‘Tapku’ and paste in the ‘src’ folder here.
Next we need to add the bundle file, which contains the bundle of images and strings to your app. Locate ‘TapkuLibrary.bundle’ under ‘TapkuLibrary’ and drag and drop it into your project, specifically the Supporting Files group.
Now you need to add the Core Animation & MapKit frameworks to your project. Select the project file in the project navigator, then select the target in the targets list. Select the Build Phases tab at the top, then expand the Link Binary With Libraries box. Click the ‘+’ button and add the QuartzCore.framework and MapKit.framework frameworks to the project.
Here we also need to add the Tapku library to the Target Dependencies. So expand ‘Target Dependencies’ and add the TapkuLibrary from the Tapku Xcode project.
Now we also need also need to add the libTapkuLibrary.a to the ‘Link Binary With Libraries’ section in the targets Build Phases. Add the ‘libTapkuLibrary.a’ by clicking the + button. Your targets Build phases should look like this afterwards:
Next, we need to tell your project where to find the TapkuLibrary headers. Select the target, then Build Settings. Search for ‘Header Search Paths’ and double-click it to add the path to the Tapku lib. So add ‘$(SRCROOT)/Coverflow/Tapku/src’ and click ‘Done’.
N.B – Make sure the path is correct based on your project name, so replace ‘Coverflow’ in the path above with your project name.
Since Tapku uses TouchJSON libraries also, we need to add these. Locate the TouchJSON folder in the ‘src/Frameworks/’ Tapku folder, and drag and drop the ‘TouchJSON’ folder onto your Frameworks group. A dialog like below appears, ensure the copy items checkbox is selected if your copying the folder from outside your project folder.
So your project should look something like this at the end of all of that.
Ok now for the fun coding part!!
In the CoverflowViewController.h header file, lets import the Tapku library and add a coverflow view. It should look as follows:
Then in the implementation file setup the cover images in an array(here i’ll be using an image i added to the project) and setup the TKCoverflowView object as follows:
Remember you’ll need to implement the datasource and view delegate methods to get it working. I also set the orientation to landscape for this demo, so the end result looks like this:
You can download the finished project here.