This was really easy to write using TextKit and UITextView, however it wouldn't have been possible using iOS 6 (hence why I dropped support for it). The only issue I ran into was the UITextView scrolling bug, however I managed to use this solution to fix it.
UICollectionView is an awesome class, and I've been using it since iOS 6 came out for my main grid of posters. Each cell contains a UIImageView of a thumbnail for each poster. I do this, rather than drawing each poster or using the poster view I use in my editor, because it has proven to be the least memory intensive and the fastest solution so far. The process for displaying images is fairly simple:
- The data source method is called to fetch the cell
- If the thumbnail for the poster is in a cache, then load it immediately
- Otherwise load it asynchronously and load it in a callback
However this still didn't produce really smooth scrolling, especially on an iPad 3 or iPhone 4. These devices had a fairly similar CPU to their predecessors (iPhone 3GS, iPad 2), but four times the number of pixels (their GPUs are much better though) which means that loading images on them tends to perform a lot worse than their immediate successors (iPhone 4S, iPad 4). My new solution is to asynchronously load the thumbnails for cells a few rows ahead (or behind, if scrolling up) the current cell. This doesn't produce a noticeable performance drop and ensures that posters are usually immediately visible when scrolling.
A framework for my apps
Since last October (with the release of Hipster Lab) I've been building a utility framework for use in my apps that simplifies a lot of common tasks. Keep Calm uses the latest version of this framework however most of the development on it this year has occurred as the result of a major update for Play Time that I've been working on. This framework will be available at some point on GitHub, but there is a lot I need to fix first.
I'd always held off putting accessibility support (for visually impaired users) into Keep Calm because I'd always thought it was far too visual an app, however I decided that it might be at least a worthwhile learning experience for me. I found that it was incredibly easy to add support and I encourage other developers to consider adding support into their app.
Keep it simple, stupid