Latest 1.0.6
License MIT
Platforms ios 9.3, requires ARC

Build Status
Carthage compatible
Swift Version

PBPopupController is a framework for presenting bars and view controllers as popup, much like the look and feel of Apple Music App.



PBPopupController allows to configure a popup bar (like the mini player of Apple Music App), dock it to the bottom bar of a presenting view container controller (like UITabBarController, UINavigationController). The presenting view controller can be any UIViewController subclass.

Each view controller can present a popup bar, docked to a bottom view. For UITabBarController subclasses, the default is the tab bar. For UINavigationController subclasses, the default view is the toolbar. For other classes, the popup bar is presented at the bottom of the screen. View controller subclasses can provide their own bottom bar views.

Once the popup bar is configured (see the properties in the PBPopupBar class) with a style, an image, a title, a sub-title, buttons, effects and colors, you present it with the above view controller providing a required popup content view controller (like the maxi player of Apple Music App).

Once the popup bar is presented with a popup content view controller, the user can swipe or tap the popup bar at any point to present the content view controller. After finishing, the user dismisses this view controller by either swiping or tapping the popup close button porvided by the system.
You can also present and dismiss the popup content view controller programmatically.

The popup bar has a prominent style for iOS 10 and below and a compact style for iOS 9. You can change these default values.

The presentation options provided by the framework are listed in the PBPopupPresentationStyle enumeration. They make the presentation look like the behavior of the Apple Music App. For iOS 9, the presentation style is fullScreen by default and for iOS 10 and below, the style is deck. You can change these default values. The custom option allows you to present the controller on a part of the screen.

Adding to Your Project


Add the following to your Cartfile:

github "iDevelopper/PBPopupController"

Make sure you follow the Carthage integration instructions here.


Drag the PBPopupController.xcodeproj project to your project, and add PBPopupController.framework to Embedded Binaries in your project target’s General tab. Xcode should sort everything else on its own.


PBPopupController is available for installation using the Cocoa dependency manager CocoaPods.

Add the following to your project’s Podfile:

pod 'PBPopupController'


  • iOS 9.3 or later.
  • ARC memory management.


  • Category methods on UIViewController.
  • Handling of rotations.
  • Plays nicely with any child view controllers or parent controllers.
  • Seamless integration of tap and pan gesture recognizers.
  • Delegate methods for getting full state of the controller and implementing your own code hooks for customizing behavior.
  • Data source methods for asking custom popup bar’ labels.
  • Full Right-To-Left support.
  • Accessibility support.

Basic API Description

  • Configuring and presenting a popup bar:

        self.tabBarController?.popupController.delegate = self
        if let popupBar = self.tabBarController?.popupBar {
            popupBar.dataSource = self
            popupBar.image = UIImage(named: "Cover01")
            popupBar.title = "Title"
            popupBar.subtitle = " A subtitle"
            popupBar.accessibilityLabel = "My custom label"
            let popupPlayButtonItem = UIBarButtonItem(image: #imageLiteral(resourceName: "play-small"), style: .plain, target: self, action: #selector(playPauseAction(_:)))
            popupPlayButtonItem.accessibilityLabel = NSLocalizedString("Play", comment: "")
            let popupNextButtonItem = UIBarButtonItem(image: #imageLiteral(resourceName: "next-small"), style: .plain, target: self, action: #selector(nextAction(_:)))
            popupNextButtonItem.accessibilityLabel = NSLocalizedString("Next track", comment: "")
            popupBar.rightBarButtonItems = [popupPlayButtonItem, popupNextButtonItem]
            let popupContentVC = self.storyboard?.instantiateViewController(withIdentifier: "PopupContentViewController") as? PopupContentViewController
            self.tabBarController?.presentPopupBar(withPopupContentViewController: popupContentVC, animated: true, completion: {
  • Opening a popup content view controller programmatically:
        self.tabBarController?.openPopup(animated: true, completion: {
  • Closing a popup content view controller programmatically:
        self.tabBarController?.closePopup(animated: true, completion: {
  • Delegate methods for getting state of the controller:

    func popupController(_ popupController: PBPopupController, stateChanged state: PBPopupPresentationState, previousState: PBPopupPresentationState) {
        PBLog("stateChanged state: (state.description) - previousState: (previousState.description)")
    func popupController(_ popupController: PBPopupController, didOpen popupContentViewController: UIViewController) {
        PBLog("didOpen - state: (popupController.popupPresentationState.description)")


  • PBPopupBar DataSource methods for providing label instances (such as MarqueeLabel):
    lazy var label: MarqueeLabel = {
        let marqueeLabel = MarqueeLabel(frame: .zero, rate: 15, fadeLength: 10)
        marqueeLabel.leadingBuffer = 0.0
        marqueeLabel.trailingBuffer = 5.0
        marqueeLabel.animationDelay = 1.0
        marqueeLabel.type = .continuous
        return marqueeLabel

    func titleLabel(for popupBar: PBPopupBar) -> UILabel? {
        return self.label
    func subtitleLabel(for popupBar: PBPopupBar) -> UILabel? {
        return self.sublabel

API Documentation

You can find the docs here. Documentation is generated with jazzy and hosted on GitHub-Pages.

Special Mention

A Special Thank to Leo Natan.

This code was inspired on her excellent framework LNPopupController.


iDevelopper, [email protected]


PBPopupController is available under the MIT license, see the LICENSE file for more information.

Please tell me when you use this controller in your project!


Patrick Bodet aka iDevelopper

Latest podspec

    "name": "PBPopupController",
    "version": "1.0.6",
    "summary": "A framework for presenting bars and view controllers as popup, much like the look and feel of Apple Music App.",
    "description": "PBPopupController is a framework for presenting bars and view controllers as popup, much like the look and feel of Apple Music App.",
    "homepage": "",
    "documentation_url": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "iDevelopper": "[email protected]"
    "platforms": {
        "ios": "9.3"
    "source": {
        "git": "",
        "tag": "1.0.6"
    "source_files": "PBPopupController/**/*.{swift,h,m}",
    "swift_version": "4.2",
    "resources": "PBPopupController/**/*.{png,jpeg,jpg,storyboard,xib,xcassets}",
    "requires_arc": true

Pin It on Pinterest

Share This