Skip to content

Instantly share code, notes, and snippets.

View jtbandes's full-sized avatar
💜
Working on @foxglove!

Jacob Bandes-Storch jtbandes

💜
Working on @foxglove!
View GitHub Profile
// replace annoying boilerplate with declarative justice using FunctionalKit:
UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
// =>
// nota bene: category on UITableView for convenient factory method is highly recommended.
id maybeCell = [[aTableView maybe] dequeueReusableCellWithIdentifier:CellIdentifier];