Skip to content

Instantly share code, notes, and snippets.

@onlyyoujack
Forked from asmallteapot/gist:1664575
Created April 14, 2012 11:50
Show Gist options
  • Save onlyyoujack/2383840 to your computer and use it in GitHub Desktop.
Save onlyyoujack/2383840 to your computer and use it in GitHub Desktop.
Using C99 for clever and non-fragile UITableView configuration. Allows implicit defaults. Copypasta’d from a screencap tweeted by @jonsterling: http://twitpic.com/80uyfp
typedef enum {
kAccomplishmentTitleSection = 0,
kAccomplishmentCategorySection,
kNumberOfSections
} NESTemplateEditTableSections;
static NSString * const kCellIdentifiers[] = {
[kAccomplishmentTitleSection] = @"AccomplishmentTitleCell",
[kAccomplishmentCategorySection] = @"AccomplishmentCategoryCell"
};
static UITableViewCellSelectionStyle const kCellSelectionStyles[] = {
[kAccomplishmentTitleSection] = UITableViewCellSelectionStyleBlue,
[kAccomplishmentCategorySection] = UITableViewCellSelectionStyleNone
};
static UITableViewCellAccesoryType const kCellAccesoryTypes[] = {
[kAccomplishmentCategorySection] = UITableViewCellAccessoryDisclosureIndicator
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment