Updated with new NS_ENUM and optional delegate checking.