Skip to content

Instantly share code, notes, and snippets.

@romyilano
Created April 15, 2013 16:51
Show Gist options
  • Select an option

  • Save romyilano/5389503 to your computer and use it in GitHub Desktop.

Select an option

Save romyilano/5389503 to your computer and use it in GitHub Desktop.
From Creating iOS5 apps Develop & Design - thanks! review of enumeations
// Enumerations provide a concise, elegant method for defining a discrete set of values
typedef enum {
SUNDAY,
MONDAY,
TUESDAY,
WEDNESDAY,
THURSDAY,
FRIDAY,
SATURDAY
} DAY;
const DAY HUMPDAY = WEDNESDAY;
// enum asisgns 0 to first constant, valus increase by 1
// you can also assign explicit values to 1 or more named constants
typedef enum {
BOLD = 1;
ITALIC = 2;
UNDERLINE = 4;
ALL_CAPS = 8;
SUBSCRIPT=16;
STRONG = BOLD;
} STYLE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment