UIViewController
public extension UIViewController
-
A Boolean value indicating whether the popup content displays the view layout with colors. The default value is
false
. If necessary, change the value totrue
..Declaration
Swift
@objc @MainActor var enablePopupColorsDebug: Bool { get set }
-
A Boolean value indicating whether the popup bar displays the view layout with colors. The default value is
false
. If necessary, change the value totrue
before accessing or configuring the popup bar.Declaration
Swift
@objc @MainActor var enablePopupBarColorsDebug: Bool { get set }
-
A Boolean value indicating whether the floating popup bar uses smooth gradient. The default value is
true
. If necessary, change the value tofalse
before accessing or configuring the popup bar.See also
smooth-gradient.Declaration
Swift
@objc @MainActor var usePopupBarSmoothGradient: Bool { get set }
-
A Boolean value indicating whether the floating popup bar uses legacy shadow (otherwise it uses NSShadow with shadowPath). The default value is
false
. If necessary, change the value totrue
before accessing or configuring the popup bar.Declaration
Swift
@objc @MainActor var usePopupBarLegacyShadow: Bool { get set }
-
The popup bar managed by the system. (read-only).
See also
PBPopupBar
.Declaration
Swift
@objc @MainActor internal(set) weak var popupBar: PBPopupBar! { get set }
-
Returns a view to attach the popup bar to.
A default implementation is provided for
UIViewController
,UINavigationController
andUITabBarController
. The default implmentation forUIViewController
returns an invisibleUIView
instance, docked to the bottom of the screen. ForUINavigationController
, the toolbar is returned. ForUITabBarController
, the tab bar is returned.Declaration
Swift
@objc @MainActor internal(set) weak var bottomBar: UIView! { get set }
-
The popup controller (read-only).
See also
Declaration
Swift
@objc @MainActor internal(set) weak var popupController: PBPopupController! { get set }
-
Returns the container (presenting) view controller for the popup bar, and for the presented view controller (popupContentViewController). May be
UIViewController
,UINavigationController
,UITabBarController
or a custom container view controller. (read-only).Declaration
Swift
@objc @MainActor internal(set) weak var popupContainerViewController: UIViewController! { get set }
-
Returns the container (presenting) view controller for the popup bar, and for the presented view controller (popupContentViewController). May be
UIViewController
,UINavigationController
,UITabBarController
or a custom container view controller. (read-only).See also
popupContainerViewController
.Declaration
Swift
@objc @MainActor internal(set) weak var popupCloseButton: PBPopupCloseButton! { get set }
-
Returns the popup content view controller of the container. If there is no popup bar presentation, the property will be
nil
. (read-only).Declaration
Swift
@objc @MainActor internal(set) weak var popupContentViewController: UIViewController! { get set }
-
Returns the view where is embedded the popupContentViewController’s view for presentation. This view has a optional close button and a visual effect view with an optional effect. (read-only).
See also
PBPopupContentView
.Declaration
Swift
@objc @MainActor internal(set) weak var popupContentView: PBPopupContentView! { get set }
-
A Boolean value indicating whether the popup bar is hidden when the view controller is pushed on to a navigation controller.
See also
hidesBottomBarWhenPushed
.Declaration
Swift
@objc @MainActor var hidesPopupBarWhenPushed: Bool { get set }
-
Custom insets that you specify to modify the container view controller’s safe area (usefull for a custom container). Use this property to adjust the safe area bottom edge inset value of this view controller’s views by the specified amount.
Declaration
Swift
@objc @MainActor var additionalSafeAreaInsetsBottomForContainer: CGFloat { get set }
-
Presents an interactive popup bar in the container’s view hierarchy and optionally opens the popup in the same animation. The popup bar is attached to the container’s bottom bar (see
popupContainerViewController
).You may call this method multiple times with different controllers, triggering replacement to the popup content view and update to the popup bar, if popup is open or bar presented, respectively.
The provided controller is retained by the system and will be released once a different controller is presented or when the popup bar is dismissed.
See also
PBPopupBar.customPopupBarViewController
for a custom popup bar view controller.PBPopupController.dataSource
for a custom bottom bar view.presentPopupBar(withPopupContentViewController:animated:completion:)
.Declaration
Swift
@objc @MainActor func presentPopupBar(withPopupContentViewController controller: UIViewController!, openPopup: Bool, animated: Bool, completion: (() -> Swift.Void)? = nil)
Parameters
controller
The presented view controller for popup presentation.
openPopup
Pass
true
to open the popup in the same animation; otherwise, passfalse
.animated
Pass
true
to animate the presentation; otherwise, passfalse
.completion
The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
-
Presents an interactive popup bar in the container’s view hierarchy. The popup bar is attached to the container’s bottom bar (see
popupContainerViewController
).You may call this method multiple times with different controllers, triggering replacement to the popup content view and update to the popup bar, if popup is open or bar presented, respectively.
The provided controller is retained by the system and will be released once a different controller is presented or when the popup bar is dismissed.
See also
PBPopupBar.customPopupBarViewController
for a custom popup bar view controller.PBPopupController.dataSource
for a custom bottom bar view.presentPopupBar(withPopupContentViewController:openPopup:animated:completion:)
.Declaration
Swift
@objc @MainActor func presentPopupBar(withPopupContentViewController controller: UIViewController!, animated: Bool, completion: (() -> Swift.Void)? = nil)
Parameters
controller
The presented view controller for popup presentation.
animated
Pass
true
to animate the presentation; otherwise, passfalse
.completion
The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
-
Dismisses the popup presentation, closing the popup if open and dismissing the popup bar.
- animated: Pass
true
to animate the presentation; otherwise, passfalse
. - completion: The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
Declaration
Swift
@objc @MainActor func dismissPopupBar(animated: Bool, completion: (() -> Swift.Void)? = nil)
- animated: Pass
-
Hide the popup bar.
- animated: Pass
true
to animate the presentation; otherwise, passfalse
. - completion: The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
Declaration
Swift
@objc @MainActor func hidePopupBar(animated: Bool, completion: (() -> Swift.Void)? = nil)
- animated: Pass
-
Show the popup bar.
- animated: Pass
true
to animate the presentation; otherwise, passfalse
. - completion: The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
Declaration
Swift
@objc @MainActor func showPopupBar(animated: Bool, completion: (() -> Swift.Void)? = nil)
- animated: Pass
-
Presents an interactive popup view controller in the container’s view hierarchy. The popup bar is not visible and the popup is attached or not to the container’s bottom bar (see
popupContainerViewController
) depending on theisFloating
parameter.You may call this method multiple times with different controllers, triggering replacement to the popup content view and update to the popup bar, if popup is open or bar presented, respectively.
The provided controller is retained by the system and will be released once a different controller is presented or when the popup bar is dismissed.
See also
PBPopupBar.customPopupBarViewController
for a custom popup bar view controller.PBPopupController.dataSource
for a custom bottom bar view.presentPopupBar(withPopupContentViewController:openPopup:animated:completion:)
.Declaration
Swift
@objc @MainActor func presentPopup(withPopupContentViewController controller: UIViewController!, size: CGSize = .zero, isFloating: Bool = true, animated: Bool, completion: (() -> Swift.Void)? = nil)
Parameters
controller
The presented view controller for popup presentation.
size
The popup content view size (optional). May be set by the controller in viewDidLayoutSubviews.
isFloating
A Boolean value that indicates whether the popup is floating (
true
) or not (false
).animated
Pass
true
to animate the presentation; otherwise, passfalse
.completion
The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
-
Dismisses the popup presentation, closing the popup if open.
- animated: Pass
true
to animate the presentation; otherwise, passfalse
. - completion: The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
Declaration
Swift
@objc @MainActor func dismissPopup(animated: Bool, completion: (() -> Swift.Void)? = nil)
- animated: Pass
-
Opens the popup, displaying the content view controller’s view.
- animated: Pass
true
to animate the presentation; otherwise, passfalse
. - completion: The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
Declaration
Swift
@objc @MainActor func openPopup(animated: Bool, completion: (() -> Swift.Void)? = nil)
- animated: Pass
-
Closes the popup, hiding the content view controller’s view.
- animated: Pass
true
to animate the presentation; otherwise, passfalse
. - completion: The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.
Declaration
Swift
@objc @MainActor func closePopup(animated: Bool, completion: (() -> Swift.Void)? = nil)
- animated: Pass
-
Call this method to update the popup bar appearance (style, tint color, etc.) according to its docking view. You should call this after updating the docking view. If the popup bar’s
inheritsVisualStyleFromBottomBar
property is set tofalse
, this method has no effect.Declaration
Swift
@objc @MainActor func updatePopupBarAppearance()
-
Undocumented
Declaration
Swift
@MainActor func popupContainerViewController(for viewController: UIViewController? = nil) -> UIViewController?