PTBarButtonItemCustomView

@interface PTBarButtonItemCustomView : UIView

@property (nonatomic, strong, nullable) UIView *contentView;

@property (nonatomic, strong) PTBadgeIndicatorView *badgeIndicatorView;

- (instancetype)initWithContentView:(UIView *)contentView NS_DESIGNATED_INITIALIZER;

- (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;

- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;

/**
 * Whether this view's left and/or right layout margins are removed when the left and/or right edge
 * of the view is aligned to its superview's edge(s).
 *
 * This is needed when used inside a `UIToolbar` or `UINavigationBar` because for custom views of a
 * `UIBarButtonItem` at the leading or trailing end of the bar, the bar's layout margin for that end
 * is not adjusted. For a `UIBarButtonItem` at the end of a bar without a custom view, the bar's
 * layout margin will be adjusted to align the button's image or title (*not* the button's layout margin)
 * with the bar's layout margin.
 *
 * The default value of this property is `YES`.
 */
@property (nonatomic, assign) BOOL adjustsLayoutMarginsForSuperview;

@end

Undocumented

  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIView *contentView

    Swift

    var contentView: UIView? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) PTBadgeIndicatorView *badgeIndicatorView

    Swift

    var badgeIndicatorView: PTBadgeIndicatorView { get set }
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithContentView:(UIView *)contentView NS_DESIGNATED_INITIALIZER;

    Swift

    init(contentView: UIView)
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;

    Swift

    init(frame: CGRect)
  • Undocumented

    Declaration

    Objective-C

    - (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;

    Swift

    init?(coder: NSCoder)
  • Whether this view’s left and/or right layout margins are removed when the left and/or right edge of the view is aligned to its superview’s edge(s).

    This is needed when used inside a UIToolbar or UINavigationBar because for custom views of a UIBarButtonItem at the leading or trailing end of the bar, the bar’s layout margin for that end is not adjusted. For a UIBarButtonItem at the end of a bar without a custom view, the bar’s layout margin will be adjusted to align the button’s image or title (not the button’s layout margin) with the bar’s layout margin.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL adjustsLayoutMarginsForSuperview;

    Swift

    var adjustsLayoutMarginsForSuperview: Bool { get set }