PTPanelViewController


@interface PTPanelViewController : UIViewController

A container view controller that can display its child view controllers in a “panel” layout, where a panel can be shown or hidden and can be, optionally, resized by the user.

  • Whether the panels controlled by this view controller are enabled.

    When disabled, calls to the -showLeadingViewController:animated: and -showTrailingViewController:animated: methods will present the provided view controller instead of adding the view controller to a panel.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=arePanelsEnabled) BOOL panelsEnabled;

    Swift

    var arePanelsEnabled: Bool { get set }
  • Whether the panels can be resized by a drag gesture.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isPanelResizingEnabled) BOOL panelResizingEnabled;

    Swift

    var isPanelResizingEnabled: Bool { get set }
  • Notifies the delegate of when the panel controller is shown and dismissed.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<PTPanelViewControllerDelegate> delegate;

    Swift

    weak var delegate: (any PTPanelViewControllerDelegate)? { get set }
  • The child view controller that contains the main content.

    The default value of this property is nil.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIViewController *contentViewController;

    Swift

    var contentViewController: UIViewController? { get set }
  • The content container view that contains the main content of this view controller.

    The root UIView of the contentViewController is added as a subview to this view.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIView *_Nonnull containerView;

    Swift

    var containerView: UIView { get }
  • The child view controller that is shown in the leadingPanel view.

    The default value of this property is nil.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIViewController *leadingViewController;

    Swift

    var leadingViewController: UIViewController? { get set }
  • Shows the specified view controller in the leading panel as a child view controller.

    Declaration

    Objective-C

    - (void)showLeadingViewController:(nonnull UIViewController *)viewController;

    Swift

    func showLeading(_ viewController: UIViewController)
  • Shows the specified view controller in the leading panel as a child view controller, optionally animated the presentation.

    Declaration

    Objective-C

    - (void)showLeadingViewController:(nonnull UIViewController *)viewController
                             animated:(BOOL)animated;

    Swift

    func showLeading(_ viewController: UIViewController, animated: Bool)
  • Hides the leading view controller if shown as a panel, or dismisses the presented view controller.

    Declaration

    Objective-C

    - (void)dismissLeadingViewController;

    Swift

    func dismissLeadingViewController()
  • Hides the leading view controller if shown as a panel, or dismisses the presented view controller, optionally animating the dismissal.

    Declaration

    Objective-C

    - (void)dismissLeadingViewControllerAnimated:(BOOL)animated;

    Swift

    func dismissLeadingViewController(animated: Bool)
  • The leading panel container view.

    The root view of the leadingViewController is added to this view.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) PTPanelView *_Nonnull leadingPanel;

    Swift

    var leadingPanel: PTPanelView { get }
  • Whether the leading panel is hidden.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isLeadingPanelHidden) BOOL leadingPanelHidden;

    Swift

    var isLeadingPanelHidden: Bool { get set }
  • Sets whether the leading panel is hidden, optionally animating the change.

    Declaration

    Objective-C

    - (void)setLeadingPanelHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setLeadingPanelHidden(_ hidden: Bool, animated: Bool)
  • The child view controller that is shown in the trailingPanel view.

    The default value of this property is nil.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIViewController *trailingViewController;

    Swift

    var trailingViewController: UIViewController? { get set }
  • Shows the specified view controller in the trailing panel as a child view controller.

    Declaration

    Objective-C

    - (void)showTrailingViewController:(nonnull UIViewController *)viewController;

    Swift

    func showTrailingViewController(_ viewController: UIViewController)
  • Shows the specified view controller in the trailing panel as a child view controller, optionally animating the presentation.

    Declaration

    Objective-C

    - (void)showTrailingViewController:(nonnull UIViewController *)viewController
                              animated:(BOOL)animated;

    Swift

    func showTrailingViewController(_ viewController: UIViewController, animated: Bool)
  • Hides the trailing view controller if shown as a panel, or dismisses the presented view controller.

    Declaration

    Objective-C

    - (void)dismissTrailingViewController;

    Swift

    func dismissTrailingViewController()
  • Hides the trailing view controller if shown as a panel, or dismisses the presented view controller, optionally animating the dismissal.

    Declaration

    Objective-C

    - (void)dismissTrailingViewControllerAnimated:(BOOL)animated;

    Swift

    func dismissTrailingViewController(animated: Bool)
  • The trailing panel container view.

    The root view of the trailingViewController is added to this view.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) PTPanelView *_Nonnull trailingPanel;

    Swift

    var trailingPanel: PTPanelView { get }
  • Whether the trailing panel is hidden.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isTrailingPanelHidden) BOOL trailingPanelHidden;

    Swift

    var isTrailingPanelHidden: Bool { get set }
  • Sets whether the trailing panel is hidden, optionally animating the change.

    Declaration

    Objective-C

    - (void)setTrailingPanelHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setTrailingPanelHidden(_ hidden: Bool, animated: Bool)