Skip to content

Instantly share code, notes, and snippets.

View jtbandes's full-sized avatar
🗾
Traveling

Jacob Bandes-Storch jtbandes

🗾
Traveling
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];