PBPopupBar

@objc
public class PBPopupBar : UIView

A popup bar presented with a container view controller such as a UITabBarController, a UINavigationController, a UIViewController or a custom container view controller. The user can swipe or tap the popup bar at any point to present the popup content view controller. After presenting, the user dismisses the popup content view controller by either swiping or tapping an optional popup close button. The contents of the popup bar is built dynamically using its own properties. The popup bar may be a custom one if PBPopupBar.customPopupBarViewController is set.

Public Properties

  • The data source of the PBPopupBar object.

    Declaration

    Swift

    @objc
    weak public var dataSource: PBPopupBarDataSource? { get set }
  • The previewing delegate object mediates the presentation of views from the preview (peek) view controller and the commit (pop) view controller. In practice, these two are typically the same view controller. The delegate performs this mediation through your implementation of the methods of the PBPopupBarPreviewingDelegate protocol.

    Declaration

    Swift

    @objc
    weak public var previewingDelegate: PBPopupBarPreviewingDelegate?
  • For debug: If true, the popup bar will attribute some colors to its subviews.

    Declaration

    Swift

    @available(*, deprecated, message: "Use enablePopupBarColorsDebug on presentation container view controller instead")
    @objc
    public var PBPopupBarShowColors: Bool
  • The popup bar presentation duration when presenting from hidden to closed state.

    Declaration

    Swift

    @objc
    public var popupBarPresentationDuration: TimeInterval
  • The tap gesture recognizer attached to the popup bar for presenting the popup content view.

    Declaration

    Swift

    @available(*, deprecated, message: "Use PBPopupController.popupBarTapGestureRecognizer instead")
    @objc
    public var popupTapGestureRecognizer: UITapGestureRecognizer!
  • Set this property with a custom popup bar view controller object to provide a popup bar with custom content. In this custom view controller, use the preferredContentSize property to set the size of the custom popup bar (example: preferredContentSize = CGSize(width: -1, height: 65)).

    Declaration

    Swift

    @objc
    public var customPopupBarViewController: UIViewController? { get set }
  • Set this property to true if you want the custom popup bar extend under the safe area, to the bottom of the screen.

    When a popup bar is presented on a view controller with the system bottom docking view, or a navigation controller with hidden toolbar, the popup bar’s background view will extend under the safe area.

    Declaration

    Swift

    @objc
    public var shouldExtendCustomBarUnderSafeArea: Bool
  • If true, the popup bar will automatically inherit its style from the bottom bar.

    Declaration

    Swift

    @objc
    public var inheritsVisualStyleFromBottomBar: Bool { get set }
  • A Boolean value that indicates whether the popup bar is floating like in iOS 17 (true) or not (false).

    Declaration

    Swift

    @objc
    public var isFloating: Bool { get set }
  • The default corner radius for the floating popup bar.

    Declaration

    Swift

    @objc
    public var floatingRadius: CGFloat
  • The default insets for the floating popup bar

    Declaration

    Swift

    @objc
    public var floatingInsets: UIEdgeInsets
  • The popup bar style (see PBPopupBarStyle).

    Declaration

    Swift

    @objc
    public var popupBarStyle: PBPopupBarStyle { get set }
  • The bar style of the popup bar toolbar.

    Declaration

    Swift

    @objc
    public var barStyle: UIBarStyle { get set }
  • The popup bar’s background effect. Use nil to use the most appropriate background style for the environment.

    Declaration

    Swift

    @objc
    public var backgroundEffect: UIBlurEffect? { get set }
  • The floating popup bar’s background effect. Use nil to use the most appropriate background style for the environment.

    Declaration

    Swift

    @objc
    public var floatingBackgroundEffect: UIBlurEffect? { get set }
  • The popup bar background style that specifies its visual effect appearance.

    See also

    UIBlurEffect.Style

    Declaration

    Swift

    @objc
    public var backgroundStyle: UIBlurEffect.Style { get set }
  • A Boolean value that indicates whether the popup bar is translucent (true) or not (false).

    Declaration

    Swift

    @objc
    public var isTranslucent: Bool { get set }
  • The popup bar’s background custom view (usefull for custom bars). This view is composited over backgroundEffect, backgroundImage and backgroundColor.

    Declaration

    Swift

    @objc
    public var backgroundCustomView: UIView? { get set }
  • The background color of the popup bar’s background view.

    Declaration

    Swift

    override public var backgroundColor: UIColor? { get set }
  • The floating popup bar’s background color. Use nil to use the most appropriate background style for the environment. This color is composited over floatingBackgroundEffect.

    Declaration

    Swift

    @objc
    public var floatingBackgroundColor: UIColor? { get set }
  • The popup bar’s background image. Use nil to use the most appropriate background style for the environment. This image is composited over the floatingBackgroundColor, and resized per the floatingBackgroundImageContentMode.

    Declaration

    Swift

    @objc
    public var backgroundImage: UIImage? { get set }
  • The content mode to use when rendering the backgroundImage. Defaults to UIViewContentModeScaleToFill. UIViewContentModeRedraw will be reinterpreted as UIViewContentModeScaleToFill.

    Declaration

    Swift

    @objc
    public var backgroundImageContentMode: UIView.ContentMode { get set }
  • The floating popup bar’s background image. Use nil to use the most appropriate background style for the environment. This image is composited over the floatingBackgroundColor, and resized per the floatingBackgroundImageContentMode.

    Declaration

    Swift

    @objc
    public var floatingBackgroundImage: UIImage? { get set }
  • The content mode to use when rendering the floatingBackgroundImage. Defaults to UIViewContentModeScaleToFill. UIViewContentModeRedraw will be reinterpreted as UIViewContentModeScaleToFill.

    Declaration

    Swift

    @objc
    public var floatingBackgroundImageContentMode: UIView.ContentMode { get set }
  • The shadow displayed underneath the floating popup bar background. Read only but its properties can be changed.

    Declaration

    Swift

    @objc
    public internal(set) var floatingBackgroundShadow: NSShadow! { get }
  • The tint color to apply to the popup bar items.

    Declaration

    Swift

    override public var tintColor: UIColor! { get set }
  • The popup bar’s image.

    Note

    The image will only be displayed on prominent popup bars.

    Declaration

    Swift

    @objc
    public var image: UIImage? { get set }
  • An image view displayed when the bar style is prominent. (read-only)

    Declaration

    Swift

    @objc
    public internal(set) var imageView: UIImageView! { get }
  • The view providing a shadow layer to the popup bar image view.

    Note

    Read-only, but its properties can be set. For example for no shadow, use popupBar.shadowImageView.shadowOpacity = 0.

    Declaration

    Swift

    @objc
    public private(set) var shadowImageView: PBPopupRoundShadowImageView! { get }
  • The popup bar’s title.

    Note

    If no subtitle is set, the title will be centered vertically.

    Declaration

    Swift

    @objc
    public var title: String? { get set }
  • Display attributes for the popup bar’s title text.

    You may specify the font, text color, and shadow properties for the title in the text attributes dictionary, using the keys found in NSAttributedString.h.

    Declaration

    Swift

    @objc
    public var titleTextAttributes: [NSAttributedString.Key : Any]? { get set }
  • The popup bar’s subtitle.

    Note

    If no title is set, the subtitle will be centered vertically.

    Declaration

    Swift

    @objc
    public var subtitle: String? { get set }
  • Display attributes for the popup bar’s subtitle text.

    You may specify the font, text color, and shadow properties for the subtitle in the text attributes dictionary, using the keys found in NSAttributedString.h.

    Declaration

    Swift

    @objc
    public var subtitleTextAttributes: [NSAttributedString.Key : Any]? { get set }
  • The string that succinctly identifies the accessibility element (titles view, the container for title and subtitle labels).

    Declaration

    Swift

    override public var accessibilityLabel: String? { get set }
  • The string that briefly describes the result of performing an action on the accessibility title view (container for title and subtitle labels).

    Declaration

    Swift

    override public var accessibilityHint: String? { get set }
  • The semantic description of the view’s contents, used to determine whether the view should be flipped when switching between left-to-right and right-to-left layouts.

    Defaults to UISemanticContentAttribute.unspecified

    Declaration

    Swift

    override public var semanticContentAttribute: UISemanticContentAttribute { get set }
  • An array of custom bar button items to display on the left side. Or right side if RTL.

    Declaration

    Swift

    @objc
    public var leftBarButtonItems: [UIBarButtonItem]? { get set }
  • An array of custom bar button items to display on the right side. Or left side if RTL.

    Declaration

    Swift

    @objc
    public var rightBarButtonItems: [UIBarButtonItem]? { get set }
  • The semantic description of the bar items, used to determine the order of bar items when switching between left-to-right and right-to-left layouts.

    Defaults to UISemanticContentAttribute.playback

    Declaration

    Swift

    @objc
    public var barButtonItemsSemanticContentAttribute: UISemanticContentAttribute { get set }
  • The popup bar’s progress view style.

    Declaration

    Swift

    @objc
    public var progressViewStyle: PBPopupBarProgressViewStyle { get set }
  • The popup bar progress view’s progress.

    The progress is represented by a floating-point value between 0.0 and 1.0, inclusive, where 1.0 indicates the completion of the task. The default value is 0.0. Values less than 0.0 and greater than 1.0 are pinned to those limits.

    Declaration

    Swift

    @objc
    public var progress: Float { get set }
  • The popup bar’s border view style.

    Declaration

    Swift

    @objc
    public var borderViewStyle: PBPopupBarBorderViewStyle { get set }
  • The accessibility label of the progress, in a localized string.

    Declaration

    Swift

    @objc
    public var accessibilityProgressLabel: String?
  • The accessibility value of the progress, in a localized string.

    Declaration

    Swift

    @objc
    public var accessibilityProgressValue: String?

Public Methods