根据文件 here 我将使用 typedef .
typedef
他们建议:
typedef NS_ENUM(NSUInteger, SexyTooltipArrowDirection) { SexyTooltipArrowDirectionUp, SexyTooltipArrowDirectionDown, SexyTooltipArrowDirectionLeft, SexyTooltipArrowDirectionRight };
我很困惑 类型定义 在我定义它之后,它是如何使用的。我将如何实现文档中描述的这一点?
类型定义
有一个例子 SexyTooltip.h :
SexyTooltip.h
SexyTooltip *tooltip = [[SexyTooltip alloc] initWithView:self.instructionsView]; tooltip.permittedArrowDirections = @[@(SexyTooltipArrowDirectionDown), @(SexyTooltipArrowDirectionUp)];
您不创建问题中显示的枚举,该枚举已经为您提供。