I'm using the notification banner to show text directions, and I've added arrows to the leftView and rightView, respectively:
I want to perform an action when one of the subviews is tapped, but those actions are not being fired. I've tried adding a UITapGestureRecognizer to each subview, but it seems that the banner is swallowing all touch events. How can I detect whether the left or the right arrow was tapped and perform an action?
I realized that a UIButton already does what I'm trying to do, so I switched out the imageViews with buttons and now they correctly receive touch events.
Problem
I'm using the notification banner to show text directions, and I've added arrows to the
leftView
andrightView
, respectively:I want to perform an action when one of the subviews is tapped, but those actions are not being fired. I've tried adding a
UITapGestureRecognizer
to each subview, but it seems that the banner is swallowing all touch events. How can I detect whether the left or the right arrow was tapped and perform an action?Code
Creating the tappable
UIImageView
Creating the
FloatingNotificationBanner
Call Site