LeoNatan/LNPopupController
 Watch   
 Star   
 Fork   
7 hours ago
LNPopupController

v4.3.3

  • Popup bar item metrics and spacing have changed; if you’ve previously set the width of a bar button item or sized your custom bar button item view with additional padding, this may no longer be necessary
  • Fixed a multitude of layout and logic issues, going back to iOS 16
  • Fixed several crashes on older iOS versions
7 hours ago
LNPopupController

v4.3.2

  • Popup bar item metrics and spacing have changed; if you’ve previously set the width of a bar button item or sized your custom bar button item view with additional padding, this may no longer be necessary
  • Fixed a multitude of layout and logic issues, going back to iOS 16
  • Fixed several crashes on older iOS versions
2 days ago
LNPopupController

v4.3.1

4.3.1

  • Fixed a button style logic on iOS 18.x and earlier.

4.3.0

Introducing popup item paging in popup bars!

For this, a new popup item management mode is introduced.

In this mode, you provide a data source to the popup bar, which can provide one or more popup items. This decouples the popup item from the content controller and allows for more advanced scenarios, such as popup item paging. You activate this mode by setting popup bar's usesContentControllersAsDataSource to false.

Before presenting a content controller, you must either provide an initial popup item or set the popup bar's data source, and implement initialPopupItem(for:) optional method. The system will use this popup item for popup bar presentation. Updates to popup items are tracked, and the popup bar is automatically updated with the latest information.

At any point, you can set the popup bar's popupItem with a new popup item. Whenever a popup bar's popup item changes, the UIViewController.popupItemDidChange(_:) method is called to let the content controller know its popup item has changed.

class PopupContentViewController: UIViewController {
	init() {
		// ...
	}
	
	override func popupItemDidChange(_ previousPopupItem: LNPopupItem?) {
		// Handle updating the content view hierarchy with the new popup item
	}
}

func presentPopupBar() {
	tabBarController?.popupBar.usesContentControllersAsDataSource = false
	
	let initialPopupItem = LNPopupItem()
	initialPopupItem.title = "Hello Title"
	initialPopupItem.subtitle = "And a Subtitle!"
	initialPopupItem.progress = 0.34
	initialPopupItem.barButtonItems = [/* ... */]
	
	tabBarController?.popupBar.popupItem = initialPopupItem
	
	let contentVC = PopupContentViewController()
	tabBarController?.presentPopupBar(with: contentVC)
}

Popup Item Paging

When implemented, the popup bar allows the user to page between different popup items through swiping on the title views.

To implement, you must set the popup bar's data source, and in it, implement both popupBar(_:popupItemBefore:) and popupBar(_:popupItemAfter:). Optionally, you can also set a popup bar delegate and implement popupBar(_:didDisplay:previous:) to be notified when a new popup item is displayed (in addition to the popup content controller's UIViewController.popupItemDidChange(_:) call).

func presentPopupBar() {
	// ...
	tabBarController?.popupBar.dataSource = self.model
	tabBarController?.popupBar.delegate = self
	// ...
}

// MARK: LNPopupDataSource

func popupBar(_ popupBar: LNPopupBar, popupItemBefore popupItem: LNPopupItem) -> LNPopupItem? {
	// Return a popop item representing the content before `popupItem` or `nil`
}

func popupBar(_ popupBar: LNPopupBar, popupItemAfter popupItem: LNPopupItem) -> LNPopupItem? {
	// Return a popop item representing the content after `popupItem` or `nil`
}

// MARK: LNPopupDelegate
	
func popupBar(_ popupBar: LNPopupBar, didDisplay newPopupItem: LNPopupItem, previous previousPopupItem: LNPopupItem?) {
	// Called when the popup bar's popup item changes (in addition to the content controller's `UIViewController.popupItemDidChange(_:)` call)
}

[!NOTE] In this mode, carefully consider how you route data between the different components of your app. The framework provides as much information as possible to trigger updates in your content as a response to programatic and user changes to popup items.

3 days ago
LNPopupController

v4.3.0

Introducing popup item paging in popup bars!

For this, a new popup item management mode is introduced.

In this mode, you provide a data source to the popup bar, which can provide one or more popup items. This decouples the popup item from the content controller and allows for more advanced scenarios, such as popup item paging. You activate this mode by setting popup bar's usesContentControllersAsDataSource to false.

Before presenting a content controller, you must either provide an initial popup item or set the popup bar's data source, and implement initialPopupItem(for:) optional method. The system will use this popup item for popup bar presentation. Updates to popup items are tracked, and the popup bar is automatically updated with the latest information.

At any point, you can set the popup bar's popupItem with a new popup item. Whenever a popup bar's popup item changes, the UIViewController.popupItemDidChange(_:) method is called to let the content controller know its popup item has changed.

class PopupContentViewController: UIViewController {
	init() {
		// ...
	}
	
	override func popupItemDidChange(_ previousPopupItem: LNPopupItem?) {
		// Handle updating the content view hierarchy with the new popup item
	}
}

func presentPopupBar() {
	tabBarController?.popupBar.usesContentControllersAsDataSource = false
	
	let initialPopupItem = LNPopupItem()
	initialPopupItem.title = "Hello Title"
	initialPopupItem.subtitle = "And a Subtitle!"
	initialPopupItem.progress = 0.34
	initialPopupItem.barButtonItems = [/* ... */]
	
	tabBarController?.popupBar.popupItem = initialPopupItem
	
	let contentVC = PopupContentViewController()
	tabBarController?.presentPopupBar(with: contentVC)
}

Popup Item Paging

When implemented, the popup bar allows the user to page between different popup items through swiping on the title views.

To implement, you must set the popup bar's data source, and in it, implement both popupBar(_:popupItemBefore:) and popupBar(_:popupItemAfter:). Optionally, you can also set a popup bar delegate and implement popupBar(_:didDisplay:previous:) to be notified when a new popup item is displayed (in addition to the popup content controller's UIViewController.popupItemDidChange(_:) call).

func presentPopupBar() {
	// ...
	tabBarController?.popupBar.dataSource = self.model
	tabBarController?.popupBar.delegate = self
	// ...
}

// MARK: LNPopupDataSource

func popupBar(_ popupBar: LNPopupBar, popupItemBefore popupItem: LNPopupItem) -> LNPopupItem? {
	// Return a popop item representing the content before `popupItem` or `nil`
}

func popupBar(_ popupBar: LNPopupBar, popupItemAfter popupItem: LNPopupItem) -> LNPopupItem? {
	// Return a popop item representing the content after `popupItem` or `nil`
}

// MARK: LNPopupDelegate
	
func popupBar(_ popupBar: LNPopupBar, didDisplay newPopupItem: LNPopupItem, previous previousPopupItem: LNPopupItem?) {
	// Called when the popup bar's popup item changes (in addition to the content controller's `UIViewController.popupItemDidChange(_:)` call)
}

[!NOTE] In this mode, carefully consider how you route data between the different components of your app. The framework provides as much information as possible to trigger updates in your content as a response to programatic and user changes to popup items.

11 days ago
LNPopupController

v4.2.6

  • LNPopupController now uses the system margins for UINavigationController containers
  • Fixed legacy iOS layout issues introduced previously
  • Fixed Xcode 16 compilation

[!NOTE] Xcode 16 support is going away soon! Xcode 26 will be required to compile and run LNPopupController, with iOS 13.0 still being the lowest supported iOS version. If you are not yet ready to support the new glass design in iOS 26 or macOS 26, use the UIDesignRequiresCompatibility Info.plist key with a value of true.

11 days ago
LNPopupController

v4.2.5

  • Layout improvements for UINavitationController containers on iOS 26
  • LNPopupContentView will no longer attempt to observe the popup content view controller’s overrideUserInterfaceStyle property
    • Instead, set LNPopupContentView's traitOverrides.userUnterfaceStyle or overrideUserInterfaceStyle directly
  • Fixed incorrect red tinting of galss buttons committed by mistake
12 days ago
LNPopupController

v4.2.4

  • Layout improvements for UINavitationController containers on iOS 26
  • LNPopupContentView will no longer attempt to observe the popup content view controller’s overrideUserInterfaceStyle property
    • Instead, set LNPopupContentView's traitOverrides.userUnterfaceStyle or overrideUserInterfaceStyle directly
14 days ago
LNPopupController

v4.2.3

  • Added “shiny” glass popup close button
  • More layout improvements
15 days ago
LNPopupController

v4.2.2

  • Added LNPopupCloseButton.Style.glass, .clearGlass, .prominentGlass and .prominentClearGlass popup close button styles
  • Added LNPopupCloseButton.Positioning to control the positioning of the popup close button within the popup content view
15 days ago
LNPopupController

v4.2.1

  • Improve scrolling popup content handling
  • Title layout improvements
  • Default title fonts were slightly adjusted to be in line with iOS 26
  • Added LNPopupBarAppearance.floatingBarShineEnabled