From 0671719d0d5f48c51d22551cb9df7f0aa46843e1 Mon Sep 17 00:00:00 2001 From: Karnika Advani Date: Tue, 12 Mar 2024 18:16:27 -0700 Subject: [PATCH 1/2] fix: Made sure FloatingNotificationBanner is always on top --- .../Classes/FloatingNotificationBanner.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/NotificationBanner/Classes/FloatingNotificationBanner.swift b/NotificationBanner/Classes/FloatingNotificationBanner.swift index 26abbfc8..458fdbb3 100644 --- a/NotificationBanner/Classes/FloatingNotificationBanner.swift +++ b/NotificationBanner/Classes/FloatingNotificationBanner.swift @@ -34,7 +34,8 @@ open class FloatingNotificationBanner: GrowingNotificationBanner { rightView: UIView? = nil, style: BannerStyle = .info, colors: BannerColorsProtocol? = nil, - iconPosition: IconPosition = .center + iconPosition: IconPosition = .center, + alwaysInFront: Bool = true ) { super.init( @@ -72,9 +73,13 @@ open class FloatingNotificationBanner: GrowingNotificationBanner { if let subtitleTextAlign = subtitleTextAlign { subtitleLabel!.textAlignment = subtitleTextAlign } + + if alwaysInFront { + setAlwaysInFront() + } } - public init(customView: UIView) { + public init(customView: UIView, alwaysInFront: Bool = false) { super.init(style: .customView) self.customView = customView @@ -84,6 +89,10 @@ open class FloatingNotificationBanner: GrowingNotificationBanner { } spacerView.backgroundColor = customView.backgroundColor + + if alwaysInFront { + setAlwaysInFront() + } } /** @@ -174,4 +183,7 @@ private extension FloatingNotificationBanner { contentView.layer.shouldRasterize = true } + private func setAlwaysInFront() { + self.layer.zPosition = CGFloat(Float.greatestFiniteMagnitude) + } } From bb6f89798bcb439c671f0aaec2247d25b8e4625e Mon Sep 17 00:00:00 2001 From: Karnika Advani Date: Tue, 12 Mar 2024 18:34:43 -0700 Subject: [PATCH 2/2] chore: Bump Podspec --- NotificationBannerSwift.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NotificationBannerSwift.podspec b/NotificationBannerSwift.podspec index 6a65a095..c67d7e40 100755 --- a/NotificationBannerSwift.podspec +++ b/NotificationBannerSwift.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'NotificationBannerSwift' - s.version = '3.2.1' + s.version = '3.3.0' s.summary = 'The easiest way to display in app notification banners in iOS.' s.description = <<-DESC