1. Daniel Tull
  2. DTKit


Clone wiki

DTKit / Home

No private Apple APIs were used in the making of DTKit.

About DTKit

DTKit contains components for the iPhone. Currently these are DTGridView and DTSwapView. There isn't much documentation yet, but the app contains some sample code on how to use them with example view controllers for each in the folder with the code. Hopefully I can figure out the best way to make a nice looking docset.

Both of these pieces are to handle views you create: They draw nothing but what they are given, so the design is your territory. The example application shows a grid of randomly (changing) coloured views and a swap view swapping views with random colours. Note: swap view will sometimes swap to a view with the same colour, I know I should change it.

Before using make sure to check out the License for DTKit, it's fairly liberal so you'll probably be able to use it. If you do I'd love to hear about it, mainly for my own ego.

NSDate (DTComponentExtension)

Adds methods to give access to individual parts of the date returning them as integers. Hours get returned as 24-hour numbers, regardless of whether the user is running their device in 24-hour mode or 12 hour mode.

NSString (DTPrefixString)

Adds a method to easily prefix a string with another. This other string should only be one character long. For example, if you were to retrieve the hour integer, you may want to prefix it with a zero if is less than two numbers long (eg it's before 10 in the morning) so that you always had a two character string representing the hour.


This makes creating grid-like user interfaces really simple. It contains an API that's similar to UITableView, so hopefully natural to use.

DTGridView example in the DTKit app.


A view to further simplify swapping between subviews. It allows setting various animation properties and handles the callback to clean up the old view being transitioned away from. Note: You should only add one subview to a swap view; Use the swapToView: method to animate to another view.

DTSwapView example in the DTKit app.

NSManagedObjetContext (DTDataFetching)

Extends the context to allow for easier fetching of objects from it.

MPMediaItem (DTTrackNumber)

Adds a method to easily get the track number from the media item.