Daltron / NotificationBanner

The easiest way to display highly customizable in app notification banners in iOS
MIT License
4.78k stars 662 forks source link

Dismiss banner programmatically #328

Closed gadget-man closed 3 years ago

gadget-man commented 3 years ago

How do I dismiss a floating banner programmatically within the viewcontroller? As the following gets called within a function, I'm unable to reference banner.dismiss() in a different function:

let banner = FloatingNotificationBanner(title: title, subtitle: subtitle, style: .warning) banner.autoDismiss = false banner.show(bannerPosition: .bottom, on: self)

gadget-man commented 3 years ago

Solved - I hadn't realised I just needed to declare the above at the top of the class