View

public extension View
  • Presents a popup bar with popup content.

    Declaration

    Swift

    func popup<PopupContent>(isPresented: Binding<Bool>, isOpen: Binding<Bool>? = nil, isHidden: Binding<Bool>? = nil, willPresent: (() -> Void)? = nil, onPresent: (() -> Void)? = nil, willDismiss: (() -> Void)? = nil, onDismiss: (() -> Void)? = nil, shouldOpen: (() -> Bool)? = nil, willOpen: (() -> Void)? = nil, onOpen: (() -> Void)? = nil, shouldClose: (() -> Bool)? = nil, willClose: (() -> Void)? = nil, onClose: (() -> Void)? = nil, tapGestureShouldBegin: ((_ state: PBPopupPresentationState) -> Bool)? = nil, panGestureShouldBegin: ((_ state: PBPopupPresentationState) -> Bool)? = nil, @ViewBuilder popupContent: @escaping () -> PopupContent) -> some View where PopupContent : View

    Parameters

    isPresented

    A binding to whether the popup bar is presented.

    isOpen

    A binding to whether the popup is open (optional).

    isHidden

    A binding to whether the popup is hidden (optional).

    onPresent

    A closure executed when the popup bar is presented (optional).

    onDismiss

    A closure executed when the popup bar is dismissed (optional).

    shouldOpen

    A closure executed just before the popup content view is about to be open by typing or dragging the popup bar (optional).

    willOpen

    A closure executed just before the popup content view is about to be open (optional).

    onOpen

    A closure executed when the popup opens (optional).

    shouldClose

    A closure executed just before the popup content view is about to be closed by typing the popup close button or dragging the popup content view (optional).

    willClose

    A closure executed just before the popup content view is about to be closed (optional).

    onClose

    A closure executed when the popup closes (optional).

    tapGestureShouldBegin

    A closure that asks if a gesture recognizer should begin interpreting touches (optional).

    panGestureShouldBegin

    A closure that asks if a gesture recognizer should begin interpreting touches (optional).

    popupContent

    A closure returning the content of the popup.

    Return Value

    A popup bar view.

  • Presents a popup bar with UIKit popup content view controller.

    Declaration

    Swift

    func popup(isPresented: Binding<Bool>, isOpen: Binding<Bool>? = nil, isHidden: Binding<Bool>? = nil, willPresent: (() -> Void)? = nil, onPresent: (() -> Void)? = nil, willDismiss: (() -> Void)? = nil, onDismiss: (() -> Void)? = nil, shouldOpen: (() -> Bool)? = nil, willOpen: (() -> Void)? = nil, onOpen: (() -> Void)? = nil, shouldClose: (() -> Bool)? = nil, willClose: (() -> Void)? = nil, onClose: (() -> Void)? = nil, tapGestureShouldBegin: ((_ state: PBPopupPresentationState) -> Bool)? = nil, panGestureShouldBegin: ((_ state: PBPopupPresentationState) -> Bool)? = nil, popupContentController: UIViewController) -> some View

    Parameters

    isPresented

    A binding to whether the popup bar is presented.

    isOpen

    A binding to whether the popup is open (optional).

    isHidden

    A binding to whether the popup is hidden (optional).

    onPresent

    A closure executed when the popup bar is presented (optional).

    onDismiss

    A closure executed when the popup bar is dismissed (optional).

    shouldOpen

    A closure executed just before the popup content view is about to be open by typing or dragging the popup bar (optional).

    willOpen

    A closure executed just before the popup content view is about to be open (optional).

    onOpen

    A closure executed when the popup opens (optional).

    shouldClose

    A closure executed just before the popup content view is about to be closed by typing the popup close button or dragging the popup content view (optional).

    willClose

    A closure executed just before the popup content view is about to be closed (optional).

    onClose

    A closure executed when the popup closes (optional).

    tapGestureShouldBegin

    A closure that asks if a gesture recognizer should begin interpreting touches (optional).

    panGestureShouldBegin

    A closure that asks if a gesture recognizer should begin interpreting touches (optional).

    popupContentController

    A UIKit view controller to use as the popup content controller.

    Return Value

    A popup bar view.

  • Sets the popup close button style.

    Declaration

    Swift

    func popupCloseButtonStyle(_ style: PBPopupCloseButtonStyle) -> some View

    Parameters

    style

    The popup close button style.

  • A Boolean value that indicates whether the popup bar is floating.

    Declaration

    Swift

    func isFloating(_ floating: Bool) -> some View
  • Sets the popup bar style (see PBPopupBarStyle).

    See also

    PBPopupBarStyle.

    Declaration

    Swift

    func popupBarStyle(_ style: PBPopupBarStyle) -> some View

    Parameters

    style

    The popup bar style.

  • Sets the bar style of the popup bar toolbar..

    Declaration

    Swift

    func barStyle(_ style: UIBarStyle) -> some View

    Parameters

    style

    The bar style.

  • Sets the popup bar background style that specifies its visual effect appearance.

    Declaration

    Swift

    func backgroundStyle(_ style: UIBlurEffect.Style) -> some View

    Parameters

    style

    The blur style of the effect.

  • Sets the popup bar’s background effect. Use nil to use the most appropriate background style for the environment.

    Declaration

    Swift

    func backgroundEffect(_ effect: UIBlurEffect) -> some View

    Parameters

    effect

    The popup bar’s background effect.

  • Sets the floating popup bar’s background effect. Use nil to use the most appropriate background style for the environment.

    Declaration

    Swift

    func floatingBackgroundEffect(_ effect: UIBlurEffect) -> some View

    Parameters

    effect

    The popup bar’s background effect.

  • If true, the popup bar will automatically inherit its style from the bottom bar.

    Declaration

    Swift

    func inheritsVisualStyleFromBottomBar(_ inherits: Bool) -> some View

    Parameters

    inherits

    inherit style from the bottom bar.

  • A Boolean value that indicates whether the popup bar is translucent.

    Declaration

    Swift

    func isTranslucent(_ translucent: Bool) -> some View
  • The background color of the popup bar background view.

    Declaration

    Swift

    func backgroundColor(_ color: UIColor) -> some View
  • The background color of the floating popup bar background view.

    Declaration

    Swift

    func floatingBackgroundColor(_ color: UIColor) -> some View
  • The tint color of the popup bar toolbar.

    Declaration

    Swift

    func tintColor(_ color: UIColor) -> some View
  • Sets the popup bar’s progress view style.

    Declaration

    Swift

    func popupBarProgressViewStyle(_ style: PBPopupBarProgressViewStyle) -> some View

    Parameters

    style

    the popup bar’s progress view style.

  • Sets the popup bar’s border view style. Usefull for iPad when the popup bar is the neighbour of another object.

    Declaration

    Swift

    func popupBarBorderViewStyle(_ style: PBPopupBarBorderViewStyle) -> some View

    Parameters

    style

    The popup bar’s border view style.

  • Sets the popup content view presentation style. Default presentation style is deck, was fullScreen for iOS 9 and above, otherwise deck.

    Declaration

    Swift

    func popupPresentationStyle(_ style: PBPopupPresentationStyle) -> some View

    Parameters

    style

    The popup content view presentation style.

  • The popup content view presentation duration when presenting from closed to open state.

    Declaration

    Swift

    func popupPresentationDuration(_ duration: TimeInterval) -> some View

    Parameters

    duration

    The total duration of the animations, measured in seconds.

  • The popup content view dismissal duration when dismissing from open to closed state.

    Declaration

    Swift

    func popupDismissalDuration(_ duration: TimeInterval) -> some View

    Parameters

    duration

    The total duration of the animations, measured in seconds.

  • The threshold value used to open or close the popup content view when dragging ends.

    Declaration

    Swift

    func popupCompletionThreshold(_ threshold: CGFloat) -> some View

    Parameters

    threshold

    The amount of progress.

  • The popup content view size when popupPresentationStyle is set to custom.

    Declaration

    Swift

    func popupContentSize(_ size: CGSize) -> some View

    Parameters

    size

    The popup content view size.

  • If true, tells the popup content view presentation to ignore the form sheet presentation by default.

    Declaration

    Swift

    func popupIgnoreDropShadowView(_ ignore: Bool) -> some View

    Parameters

    ignore

    Default is true.

  • 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

    func shouldExtendCustomBarUnderSafeArea(_ should: Bool) -> some View

    Parameters

    should

    Extend the popup bar under safe area.

  • Sets a custom popup bar view, instead of the default system-provided bars.

    Declaration

    Swift

    func popupBarCustomView<PopupBarContent>(@ViewBuilder popupBarContent: @escaping () -> PopupBarContent) -> some View where PopupBarContent : View

    Parameters

    popupBarContent

    A closure returning the content of the popup bar custom view.

  • Gives a low-level access to the PBPopupBar object for customization, beyond what is exposed by LNPopupUI.

    The popup bar customization closure is called after all other popup bar modifiers have been applied.

    Declaration

    Swift

    func popupBarCustomizer(_ customizer: @escaping (_ popupBar: PBPopupBar) -> Void) -> some View

    Parameters

    customizer

    A customizing closure that is called to customize the popup bar object.

    popupBar

    The popup bar to customize.

  • Gives a low-level access to the PBPopupContentView object for customization, beyond what is exposed by LNPopupUI.

    The popup content view customization closure is called after all other popup content view modifiers have been applied.

    Declaration

    Swift

    func popupContentViewCustomizer(_ customizer: @escaping (_ popupBContentView: PBPopupContentView) -> Void) -> some View

    Parameters

    customizer

    A customizing closure that is called to customize the popup bar object.

    popupContentView

    The popup content view to customize.

  • Configures the view’s popup bar title and subtitle.

    Declaration

    Swift

    func popupTitle<S>(_ localizedTitleKey: S, subtitle localizedSubtitleKey: S? = nil) -> some View where S : StringProtocol

    Parameters

    localizedTitleKey

    The localized title key to display.

    localizedSubtitleKey

    The localized subtitle key to display. Defaults to nil.

  • Undocumented

    Declaration

    Swift

    func popupTitle<S>(verbatim title: S, subtitle: S? = nil) -> some View where S : StringProtocol
  • Undocumented

    Declaration

    Swift

    func popupTitle(verbatim title: String, subtitle: String? = nil) -> some View
  • Configures the view’s popup bar with custom label and sublabel.

    Declaration

    Swift

    func popupLabel(_ label: UILabel? = nil, sublabel: UILabel? = nil) -> some View

    Parameters

    label

    A UIlabel object to be used instead of the default one.

    sublabel

    A UIlabel object to be used instead of the default one.

  • Configures the view’s popup bar image.

    Declaration

    Swift

    func popupRoundShadowImage(_ image: UIImage, cornerRadius: CGFloat = 3.0, shadowColor: UIColor = UIColor.black, shadowOffset: CGSize = CGSize(width: 0.0, height: 3.0), shadowOpacity: Float = 0.5, shadowRadius: CGFloat = 3.0) -> some View

    Parameters

    image

    The image to use.

    cornerRadius

    The radius to use when drawing rounded corners for the image.

    shadowColor

    The color to use for the shadow.

    shadowOffset

    The offset (in points) of the layer’s shadow.

    shadowOpacity

    The opacity of the layer’s shadow.

    shadowRadius

    The blur radius (in points) used to render the layer’s shadow.

  • Configures the view’s popup bar image.

    Declaration

    Swift

    func popupImage(_ image: Image) -> some View

    Parameters

    image

    The image to use.

  • Configures the view’s popup bar background image.

    Declaration

    Swift

    func popupBackgroundImage(_ image: UIImage, contentMode: UIView.ContentMode) -> some View

    Parameters

    image

    The image to use.

    contentMode

    The content mode to use when rendering the backgroundImage.

  • Configures the view’s popup bar floating background image.

    Declaration

    Swift

    func popupFloatingBackgroundImage(_ image: UIImage, contentMode: UIView.ContentMode) -> some View

    Parameters

    image

    The image to use.

    contentMode

    The content mode to use when rendering the backgroundImage.

  • Configures the view’s popup bar 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

    func popupProgress(_ progress: Float) -> some View

    Parameters

    progress

    The popup bar progress.

  • Sets the bar button items to display on the popup bar.

    Declaration

    Swift

    func popupBarItems<LeadingContent>(@ViewBuilder leading: () -> LeadingContent) -> some View where LeadingContent : View

    Parameters

    leading

    A view that appears on the leading edge of the popup bar.

  • Sets the bar button items to display on the popup bar.

    Declaration

    Swift

    func popupBarItems<TrailingContent>(@ViewBuilder trailing: () -> TrailingContent) -> some View where TrailingContent : View

    Parameters

    trailing

    A view that appears on the trailing edge of the popup bar.

  • Sets the background to display on the popup content (the view to draw behind this view).

    Declaration

    Swift

    func popupContentBackground<BackgroundContent>(@ViewBuilder background: () -> BackgroundContent) -> some View where BackgroundContent : View

    Parameters

    background

    The background view of the popup content.