Open martindufort opened 1 month ago
OK, so after some reseeach, looks like the UIHostingViewController
is capturing all touch events from going underneath the overlay.
I've added this code which seems to resolve my issue. Not sure what the impact is on events handled by the SystemNotification
however
SystemNotificationUIKitOverlay.swift:36
func addAsOverlay(to view: UIView) {
let overlay = UIHostingController(rootView: self)
// Disable user interaction for overlay
overlay.view.isUserInteractionEnabled = false
view.addSubview(overlay.view)
Hi @martindufort
Oh, I haven't looked at the UIKit support stuff for a long time.
Does it work to swipe away the notification if you add that line?
Will try but my first guess is no.
@martindufort Since I rarely touch UIKit these days, feel free to make any adjustments that work for you and I'll happily merge it 😀
Will do and add a version for AppKit as well. 😉
I'm trying to integrate
SystemNotification
to a UIKit-only app usingaddAsOverlay
. Here's the setup code:In our app, we are showing a modal
pageSheet
view where users can enter data and when completed anew item added
notification would be shown.However as soon as I add the
SystemNotification
as an overlay, all touch events are not reaching the actual buttons underneath the overlay.Removing the setup code above restores the touch events.
Anything I should look for?