iosswiftnotificationsbannervibration

How turn off vibration effect on banners using NotificationBannerSwift in IOS


I use NotificationBannerSwift for showing banners in swift code:

    let banner = FloatingNotificationBanner(title: messageString,titleFont: UIFont.initFrom(style: .textBody), style: .info, colors: BannerColors())
        banner.duration = 2.0
        banner.transparency = 0.6
banner.show(queuePosition: .back, bannerPosition: .bottom, queue: NotificationBannerQueue(maxBannersOnScreenSimultaneously: 1), edgeInsets: UIEdgeInsets(top: 8, left: 8, bottom: 100, right: 8), cornerRadius: 10, shadowBlurRadius: 15)

Every banner has vibration effect.

How to switch off this vibration effect?


Solution

  • This framework automatically adding haptic for vibration try to set none.

        let banner = FloatingNotificationBanner(title: messageString,titleFont: UIFont.initFrom(style: .textBody), style: .info, colors: BannerColors())
            banner.duration = 2.0
            banner.transparency = 0.6
            banner.haptic = .none
            banner.show(queuePosition: .back, bannerPosition: .bottom, queue: NotificationBannerQueue(maxBannersOnScreenSimultaneously: 1), edgeInsets: UIEdgeInsets(top: 8, left: 8, bottom: 100, right: 8), cornerRadius: 10, shadowBlurRadius: 15)