Band App Diary #1: Initial Design Thoughts

If you read this blog lately, you know that I have (am) a band called Fisherman’s Porch, and that I’ve been making music for a long time. One idea I’ve had for a while has been to somehow combine my app making and music skills in an interesting way. I’ve also wanted a reason to do something with development that would give me some real world experience writing server side code. I’m going to follow Brent’s footsteps and put all of my design and code thoughts out there, so that hopefully I can learn something from the feedback I get.

The other day when I posted on Twitter that I was trying to think of a side project I could use Microsoft’s Azure Mobile Services to write a backend for and Nick Harris responded with this:

@collindonnell write an app for your music with a blog like feature talking about the songs.

This seems like the perfect project to try this out on for a few reasons:

  • There aren’t thousands of Fisherman’s Porch fans out there (yet!), and it’s not going to be storing a bunch of peoples important personal data, so I can experiment as much as I like with the design and backend architecture.
  • It’s not an idea anyone can “steal,” so I don’t have to be secretive at all about creating it and blog about the whole process.

An App Worth Downloading

I don’t want to make an app that’s just a static advertisement for my music, because no one will download it, and if they do, they won’t keep it. Plus, designing an app like that just isn’t as interesting to me. I want to use this to stretch my design muscles and see what I’m capable of. Ultimately, the hope is that the app could somehow get people who would have otherwise never ever heard of Fisherman’s Porch to become interested, and people who are interested to stay that way. If you think about how stupid most apps that are created to advertise different brands and whatnot actually are, it’s a pretty big goal.

So, I think it’s got to do a few of things to have a chance at achieving that. First, the content can’t suck. If my music and other things I put into it are lame, it doesn’t matter what I do. I’m going to take it as read that my content can’t suck. Good content alone is going to be enough though. There’s tons of bands with good songs no one cares about.

The second thing is that it’s got to be fun to touch and look at. The UI has to be great. It can’t look like a list of songs in the Music app. For the kind of apps I’ve created in the past (productivity mostly), I’ve gotten a lot of mileage out of “what would Mail/Contacts/Music do?” as a starting place. If I were a famous rockstar, that might fly, but I’m not at all. It has to feel like something special.

The design also needs to look full with the amount of content one person (me) can put out. If I had a table view of six songs, another separate photos view with a few photos, and a videos list with two videos on day one, that’s going to look empty. Instead of a tab bar app with a separate tab for each of those things, or some kind of table view based navigation hierarchy, I’m thinking a single feed that has everything in it. If you want to just listen to my music, you can do that in this app, but the main purpose of this app is to find out what Fisherman’s Porch is up to right now. The types of content I can think of right now are:

  • Music.
  • Videos.
  • Photos.
  • Content from social networks like Twitter, Instagram, etc.
  • Other links to things like blog posts.
  • Shows.

On the technical side whatever I do should also accommodate the possibility of me coming up with new types of content in the future. I don’t know what those are yet, but I guess that’s kind of the point. Out of all of those types of content, shows are the one that I think deserve their own special view. Giving shows their own view gives me a nice place to put things like getting a push notification if I’m playing a show nearby or requesting a show in your area. Requesting a show could be as simple as a single button. I’d store the location on my server and if I see a bunch in one general area, I can find out about booking a show there at some point.

Inside of the feed list, I think it would also be nice if people could comment on items that show up there. Review a show, give feedback on a song, that sort of thing. Of course this is the perfect place for trolls to tell me that I “totally suck, lol,” so I think before someone can leave a comment I’d ask them to authenticate with either Twitter or Facebook to remove some of the anonymity. If there’s a way to do it without being a total tool, it might be cool if I could use that as a chance to ask them to like/follow Fisherman’s Porch. I’m thinking more like a checkbox which is default off instead of an alert view that pops up in their face after they log in.

Other random things the app could maybe do that might be cool:

  • Notifications for new content. If this is annoying people will just delete the app though, so I might have it somewhere that people have to turn on instead of just on for everything by default.
  • Passbook passes for shows. Maybe.
  • Have some basic analytics so I know which songs get listened to the most or the general geographic region people who listen to my music are in. Nothing creepy, but it would be useful to know if I have a big cluster of fans in one area when I go to book a show there.

I don’t know if all of this will make it into the first version, but I’m kind of excited about this app as a place I can try new things. Since I’m already over a thousand words into this post, I think I’ll take a break and collect my thoughts on what’s all going to need to happen technically.

Dancing With weakSelf

There was a really good post on the Black Pixel blog by Rich Wardwell about the implications of capturing self in Objective-C blocks which Brent Simmon’s posted a response to on his blog. If you’re lost, I’m talking about doing this sort of thing to avoid retain cycles:

Brent’s thoughts/rules for blocks partially mimic my own1. I never use -[NSNotificationCenter addObserverForName:​queue:​usingBlock:]; I just don’t see the benefit. Unlike Brent, it’s not uncommon for me to copy a block and assign it to a property, but usually if I start having more than one or two somethingHandler blocks, creating a delegate protocol is a better fit most of the time (this code also tends to be easier to debug). I also agree that thinking about if self really needs to be used in the block at all is a good practice (Rich also mentions this).

I can’t say why exactly, but whenever I have to the whole weakSelf thing, it feels like I’m doing something wrong — it seems like kind of a code smell. That’s not to say I never do it (I do it all the time), but my general feeling is that if I need to, I should probably think about if I’m approaching this from the right angle.


  1. One difference. At some point recently I realized I’d memorized the crazy block syntax: BOOL(^someBlock)(NSString *string). I’m not too proud of this, since I’m pretty sure it points to some kind of underlying psychological disorder 

Don’t Store Static Content in Code

Sticking large blocks of static content directly in code is a bad idea, but I see it all the time. You keep your image data separate, so why have a 2000 word privacy policy stuck in the code directly? Loading content like this from static text files, as an HTML string into a web view, or keeping configuration data in a property list is a much better choice, and what I do pretty much anytime I can.

If you have code like this in your app, you’re doing it wrong:

Instead, if you’re just talking about static text with some styling, you could keep all of that in an HTML document and do something like this:

Let’s say you had a list of documents like this you needed to display, like terms and conditions and about, which were all listed as rows in a table view. Instead of coding what each row is, you could save a lot of code by putting that information into a property list. If you store the info for each document as an item in array — with keys like title and documentName — you can load that array in your view controller and then pretty much automate this whole process with two classes and a few lines of code.

On top of getting clutter out of your code and saving the amount of code you write, there’s other nice things you can do now too. For example, maybe you want to be able to update any of these documents remotely. All you need to do is check a URL, download a copy of the files into your cache directory, and check for if there’s a match there before you display the one you bundled with the app.

Getting a feel for where you can get static content of out of code and into external resource files lets you not only write better code, but less of it.

Tools to Make Software Less Dysfunctionally

Someone on Twitter the other day sent me a message asking me what tools I was using when making apps for things like issue tracking, testing, managing tasks in a project, etc. I don’t know if I’m the best example of anything, but I can tell you what’s worked and not worked for me in the past.

You Need to Write Things Down

The biggest issues I’ve had working with others have come when the team isn’t on the same page about what everyone needs from everyone else. Having a daily check-in where everyone gets together isn’t a bad thing, but it’s not a replacement for having an issue tracking and project management system in place.

If you’re thinking this can all happen in email threads: you’re wrong. An email thread is a terrible place for this sort of discussion to happen. People don’t respond, everyone has different habits when it comes to email, and people inevitably mix up 10 different topics into one thread that goes on for weeks. You need a system that allows you to create a task, assign it to someone, and have running commentary on the same page.

The best place to do that is in a dedicated issue tracker, maybe a project management tool, and a good chat system if you’re working with other people.

Issue Tracking

The issue trackers I’ve used and liked are GitHub Issues and Lighthouse. What I like about both of them is that they’re both extremely simple, reasonably freeform, and let you enter enough detail into your ticket to explain what’s going on. Some people like other tools, and that’s fine too, these are what’s worked for me. As a general rule if something gets very complicated I’ll stop wanting to use it.

Both of these will integrate with your source control repo, let you tag issues with whatever you want, create milestones (v1.0, v1.1, etc), comment on existing issues, and assign them to team members. Speaking of teams — you should be using an issue tracker even if you’re just one person. Apps like OmniFocus are great for runway level tasks, but bugs and enhancements are usually more than just a task, and you want to be able to get an idea of how they connect.

What’s great about GitHub Issues is that it’s free if you’re all ready using GitHub, and it does most of what you want. What’s better about Lighthouse is that it does everything Issues does, but a project in Lighthouse isn’t tied to a specific GitHub repo. You can’t have Issues without a repo, so if you have a project with more than one repo (e.g., web backend and iOS app), there’s no way to track things across the two.

I’d recommend giving GitHub a try until you feel yourself bumping up against the walls, and then try Lighthouse.

Project Management Tools

Project management tool like Basecamp or Asana can work well when you have a team and you need a 10,000 foot view of what you’re working on. For individuals or even small teams, I don’t think you always need one. For one person writing their own apps, I’ve only seen these used for procrastination and the kind of task shuffling that distracts people from actually making their thing.

On the size teams that I usually work with, I’ve rarely felt a dedicated project management helped up get anything done faster. Maybe for non-technical project managers, but those people are usually a net negative as well1. I imagine when a team gets to a certain size you need something like this, I just don’t generally work on teams of that size, so I don’t know.

In my experience a good issue tracker can take the place of a dedicated project management app, but not the other way around. The reason is that project management tools usually have a concept of tasks, but usually don’t have the right fields to put in all of the detail you need when tracking new features and bugs.

Group Chat

If you’re working with a team, you should have a persistent chat system. I’ve used Flowdock, HipChat and Campfire. Hipchat has the best native apps, but I prefer Flowdock because it was the easiest to integrate with other things like GitHub, was the hardest to lose track of things in and has the least ridiculous annoyances and limitations.


  1. Project managers who understand design and development, or at least stay out of everyones butt can be a different story. 

Turn Off Text Antialiasing in Xcode

I’m not sure in what way my brain is broken to cause this to bother me so much, but I’ve often found myself staring at Xcode after a long time, fixating on the antialiased text being hard to read. I’m pretty sure a retina display would solve the problem, but that isn’t an option for my iMac or MacBook Air. Instead, what you can do is pick a font which has bitmap versions included for small sizes1 and type this into Terminal:

Restart Xcode and the slightly fuzzy antialiased text will be replaced with slightly pixelated non-antialiased text.


  1. I like Anonymous Pro, which has bitmaps for up to 13pt. 

Handling Colors Better in Your Apps

When I’m working on an app something that I try to avoid is to have lines of code like this mixed in my display code:

Instead, I create a category on UIColor — called something like UIColor(MyAppColors) — and add a class method whenever I need to use a new color to the app. That makes the line above something more like:

The main reason I do this is that if I ever want to tweak a color which gets reused in multiple places, I only need to change the category method for it to be updated everywhere. It’s a good practice to avoid having literal strings and numbers strewn throughout your code, and this is a good example of why.

Brent’s Vesper Sync Diary

Brent Simmons has been writing a series of blog posts to journal how he’s been approaching sync in Vesper, and I strongly recommend reading it. Brent’s ability to think through an entire problem is something I constantly work to improve in myself. It’s the thing that really separates great developers and designers from everyone else who starts by typing, and defers thinking until something blows up.

Here’s the posts he’s published so far:

  1. Syncing Tags
  2. Core Data
  3. Immutability, Deleting, and Calculated Properties
  4. In Another Country
  5. Sync Tokens and Efficiency
  6. Merging Notes

UIManagedDocument for Core Data Apps

As someone who’s spent a lot of my career being the “Core Data guy” on many projects, I’m a bit embarrassed to admit I hadn’t taken much of a look at UIManagedDocument until now. UIManagedDocument came around with iOS 5, and I think because it seemed vaguely iCloud related (it’s not), and because none of the apps I was writing were document based (they don’t have to be), I never gave it a second thought. Now that I have, I can’t see any compelling reason to not use it for all of the apps I’m writing.

The best way to think of UIManagedDocument is as a replacement for the “Core Data Stack” class I’ve seen people write in a lot of different projects. What that class usually does is encapsulate set up of a Core Data stack into one class (NSManagedObjectContext, NSManagedObjectModel, and NSPersistentStoreCoordinator), often times with a private queue parent context for background saving. Doing this can make it as easy to set up a new stack as passing a file path and persistent store options to your class. What UIManagedDocument does is exactly everything I just said, and so it saves you having to write a bunch of boiler plate code — which is nice. Creating a new document just involves calling -[UIManagedDocument initWithFileURL:] and setting whatever persistent store options you like. You can now pass the document around as needed, or just use its managedObjectContext property to grab its context and inject that wherever you like.

But what if your app doesn’t work with documents in a way where having multiple persistent stores makes sense? Just create one document with a filename defined in your app. One good use case for using multiple documents is in an app where multiple accounts are allowed. If each account is its own document, than logging out just means deleting the file for that account. Also, since UIManagedDocument is easy to subclass, if you had an app that allows login from different services, it wouldn’t be a terrible place to put syncing logic that applies just to that service. If you were writing an app where you want to save the users data and sync through Service A, Service B or iCloud, you could write different document types to handle some specific differences for the two services and one that you place into an iCloud container.

I haven’t been using the class long enough to say that I’m sure I won’t run into any show stopping problems, but since the API is simple enough that they haven’t jumped out at me yet I’m only seeing upsides to using it right now.

FCModel and Current Thoughts on Core Data

Marco Arment’s Core Data alternative that sits on top of SQLite and FMDB is on GitHub and looks excellent. Core Data has generally worked well enough for me, but maybe not so well that I’m not interested in alternatives. What he’s done is make something simple with a couple of great features built-in:

  • Multi-threading support: Database operations happen concurrently via a serial queue, so you shouldn’t stomp all over yourself. I assume if you’re accessing your model objects in your own threads the normal rules apply.
  • Active record style access: You only need to worry about talking to your model objects and classes, which is simpler in most cases than the way Core Data does it.
  • Simple schema migration: You can version your database and then receive a callback to update your schema as needed.

The whole thing is pretty similar to what Brent Simmons describes in his objc.io article about using SQLite instead of Core Data. Brent raises a couple of reasons for wanting to do something a bit different in his article. Mostly it comes down to hitting performance walls and wanting something that’s just a bit simpler and less general. The truth is that because Core Data is a general solution which completely abstracts you away from the idea of using a database, I’m not sure there’s anyway that it couldn’t be a bit complex in places and that there wouldn’t be walls to bump up against. In my experience with Core Data everything works great except when it doesn’t, and because you’re so abstracted away from the implementation detail of it using a SQLite store, when you do hit those walls, you hit them hard. Some things I’ve run up against with Core Data are:

  1. Threading still sucks, even if it has gotten better.
  2. Tries to solve for edge cases I’m not sure anyone has and is overly complex because of it.
  3. Having to pass around an NSManagedObjectContext to do just about anything.
  4. When you have problems, it’s not always easy to find documentation that explains what’s going on.

All of that being said, I still think that Core Data does do a lot for you. The first three issues I raise are mostly mitigated by having good code hygiene and also by using MagicalRecord. Taking the time to read the documentation and also Marcus Zarra’s book on the topic (before you start using MagicalRecord), would probably solve a lot of problems for people as well.

As far as performance goes, it wasn’t easy to get there, but Pinbook imports bookmark collections in the range of 20,000+ in a few seconds on an iPhone 4S, so it is possible to get very high performance when using Core Data. I can’t imagine there’s too many iOS apps out there that have those kinds of performance requirements.

There’s also some specific things that Core Data really makes a lot easier. For example, it’s batching and faulting mechanisms work really well. One thing that I did not have to think about very much when developing an app that might need to display 50,000 items in a table view was managing memory for those items. I’m sure I could have come up with a way to handle that using a custom solution, and it wouldn’t have even been that hard, but with Core Data it was practically free. I’m also hearing from friends that Core Data sync might be finally working the way it should in iOS 7, and if that’s true, and I write an app which really just needs to make sure a users data remains in place between iPhone, iPad and Mac versions, would be awesome, although I’m not holding my breath until I have time to play with it myself.

No general solution will ever be perfect fit for every case. In those cases writing a custom solution is nothing to fear. If you’re writing a Mac or iOS app, however, Core Data probably is the right fit most of the time, and you should really consider what you’re doing when it’s not.

360iDev September 8-11 in Lone Tree Colorado

I'm excited to be given the opportunity to speak at 360iDev again in 2013. As usual, it's a great lineup this year, and there's a few talks this year that I'm really excited about. In particular Brent's SQLite and Justin's Core Image talk are two that I'll definitely be at. I'll be closing out the first day with a general session talk called App Making for Deadites about what Ash's journey in The Evil Dead movies can teach us about making great apps 1. I'll also be on a panel with my friends Matthew Henderson and Samuel Goodwin in the same room Tuesday morning.

360iDev will be held in Lone Tree Colorado September 8-11, 2013. You can buy your ticket now, or check out the schedule.


  1. I'm really hoping that I haven't grossly overestimated how many people have seen those movies.