代码之家  ›  专栏  ›  技术社区  ›  Austin Berenyi

我如何为我的sexytooltip实例定义允许的箭头方向?

  •  0
  • Austin Berenyi  · 技术社区  · 6 年前

    根据文件 here 我将使用 typedef .

    他们建议:

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

    我很困惑 类型定义 在我定义它之后,它是如何使用的。我将如何实现文档中描述的这一点?

    1 回复  |  直到 6 年前
        1
  •  1
  •   rmaddy    6 年前

    有一个例子 SexyTooltip.h :

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

    您不创建问题中显示的枚举,该枚举已经为您提供。