UIBarItem(FWBadge)

@interface UIBarItem (FWBadge)

/// 获取UIBarItem(UIBarButtonItem、UITabBarItem)内部的view,通常对于navigationItem和tabBarItem而言,需要在设置为item后并且在bar可见时(例如 viewDidAppear:及之后)获取fwView才有值
@property (nullable, nonatomic, weak, readonly) UIView *fw_view NS_REFINED_FOR_SWIFT;

/// 当item内的view生成后就会调用一次这个block,仅对UIBarButtonItem、UITabBarItem有效
@property (nullable, nonatomic, copy) void (^fw_viewLoadedBlock)(__kindof UIBarItem *item, UIView *view) NS_REFINED_FOR_SWIFT;

@end

Undocumented

  • 获取UIBarItem(UIBarButtonItem、UITabBarItem)内部的view,通常对于navigationItem和tabBarItem而言,需要在设置为item后并且在bar可见时(例如 viewDidAppear:及之后)获取fwView才有值

    Declaration

    Objective-C

    @property (nonatomic, weak, readonly, nullable) UIView *fw_view;
  • 当item内的view生成后就会调用一次这个block,仅对UIBarButtonItem、UITabBarItem有效

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) void (^) (__kindof UIBarItem *_Nonnull __strong, UIView *_Nonnull __strong) fw_viewLoadedBlock;