iosobjective-ctypedefnsenumerator

How do I define permitted arrow directions for my instance of SexyTooltip?


According to the documentation here I am to specify an array of my arrow directions for SexyTooltip using a typedef.

They suggest:

typedef NS_ENUM(NSUInteger, SexyTooltipArrowDirection) {
    SexyTooltipArrowDirectionUp,
    SexyTooltipArrowDirectionDown,
    SexyTooltipArrowDirectionLeft,
    SexyTooltipArrowDirectionRight
};

I'm confused about what a typedef is and how I would use it after I define it. How would I implement this as described in the documentation?


Solution

  • There is an example in the SexyTooltip.h:

    SexyTooltip *tooltip = [[SexyTooltip alloc] initWithView:self.instructionsView];
    tooltip.permittedArrowDirections = @[@(SexyTooltipArrowDirectionDown), @(SexyTooltipArrowDirectionUp)];
    

    You do not create the enum shown in your question, that is already provided for you.