Introducing ASKit

Shaun, Jan 8

After seeing a bunch of attempts at AppStore-themed apps on AppStore that (in our opinion), weren't so good, we decided to release the code that we used in Groundwork as a library for everyone to use.

You can get the code over at GitHub:

Here's how you actually use it:

There's three main things that you'll need to change to use ASKit;

  1. You'll need to make your table extend ASTableViewController instead of UITableViewController
  2. Any custom subclasses you have for UITableViewCell should be switched to ASTableViewCell, other then that, you can use it the same as UITableViewCell.
  3. In order to have the alternating row colors, you need to define it yourself (it looks horrible if you don't). Here's an example of what your new tableView:cellForRowAtIndexPath: method will look like with ASKit:

Since we had a pretty simple table with only 1 section, we handle the alternate row this way:

cell.alternate = indexPath.row % 2 == 0;

If you have multiple sections, you'll need write something a bit more complex.

As far as a basic, quick ASTable goes, thats a bout it. From there, things can get as complicated as you need them to. If you want to create a "header" like in the screenshot, it's pretty straight forward; you set the "header" view by subclassing ASHeaderView and setting your tables header:

ASTableViewController will handle the rest, the only thing to note about ASHeaderView is that, just like UITableViewCell, you'll need to add any subviews to self.contentView and not self since ASTableViewController modifies the main view as you scroll.

If you have any questions drop us a comment and we'll get back to you.


blog comments powered by Disqus