Wednesday, October 28, 2026
HomeiOS Developmentios - Swipe to return in particular SwiftUI views

ios – Swipe to return in particular SwiftUI views

[ad_1]

In my SwiftUI app I’ve set in all my views .navigationBarBackButtonHidden(true) to have at all times a customized Again Button, so the iOS traditional swipe to return has been disabled in every single place, however I really need it solely in particular views.

I re enabled it utilizing this code:

extension UINavigationController: UIGestureRecognizerDelegate {
    override open func viewDidLoad() {
        tremendous.viewDidLoad()
        interactivePopGestureRecognizer?.delegate = self
    }

    public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        return viewControllers.depend > 1
    }
}

It really works however sadly it re allows swipe to return in all the mission, what ought to I do?

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments