TipUIPopoverViewController disables all the views from presenting screen

when using Tips with UIKit, presenting TipUIPopoverViewController disables all the buttons from the presenting screen.

I assume this is the expected behaviour but is there a way to disable it? I would like the button that the tip is pointing to to be still enabled. Otherwise user has to tap on it twice which is not ideal.

Method checking for tip's eligibility.

private extension MenuViewController {
    func activateTips() {
        Task { @MainActor [weak self] in
            guard let self else {
                return
            }
            for await shouldDisplay in createMapTip.shouldDisplayUpdates {
                if shouldDisplay {
                    let controller = TipUIPopoverViewController(createMapTip, sourceItem: createMapButton) { [weak self] action in
                        if action.id == "LearnAboutMaps" {
                            if self?.presentedViewController is TipUIPopoverViewController {
                                self?.dismiss(animated: true) {
                                    self?.createMapTip.invalidate(reason: .actionPerformed)
                                    self?.viewModel.handle(.didTapLearnMoreAboutMaps)
                                }
                            }
                        }
                    }
                    present(controller, animated: true)
                }
                else if presentedViewController is TipUIPopoverViewController {
                    dismiss(animated: true)
                }
            }
        }
    }
}

Try setting the passthroughViews property on TipUIPopoverViewController's popoverPresentationController

https://developer.apple.com/documentation/uikit/uipopoverpresentationcontroller/1622312-passthroughviews?language=objc

Include the view controller's view that you are presenting in the array.

tipUIPopoverViewController.popoverPresentationController.passthroughViews = @[self.view];
//then present it.

Unfortunately I can't test this myself because even though TipUIPopoverViewController is a view controller subclass for whatever reason they decided not to include a header file that can be imported into Objective-C which is just bizarre.

Extra note: It's worth adding that this behaviour is the opposite from SwiftUI implementation. From Apple's TipKitExamples app:

            Image(systemName: "wand.and.stars")
                .imageScale(.large)
                // Add the popover to the feature you want to highlight.
                 .popoverTip(tip)
                .onTapGesture {
                    // Invalidate the tip when someone uses the feature.
                    tip.invalidate(reason: .actionPerformed)
                }

This piece of code does not disable the touch for underlaying views

Accepted Answer

Try setting the passthroughViews property on TipUIPopoverViewController's popoverPresentationController

https://developer.apple.com/documentation/uikit/uipopoverpresentationcontroller/1622312-passthroughviews?language=objc

Include the view controller's view that you are presenting in the array.

tipUIPopoverViewController.popoverPresentationController.passthroughViews = @[self.view];
//then present it.

Unfortunately I can't test this myself because even though TipUIPopoverViewController is a view controller subclass for whatever reason they decided not to include a header file that can be imported into Objective-C which is just bizarre.

TipUIPopoverViewController disables all the views from presenting screen
 
 
Q