ios – NavigationController buttons not responding to the touch


That is my code to arrange the navigationcontroller contained in the ChatMessageVC:

        self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for:.default)
        self.navigationController?.navigationBar.shadowImage = UIImage()
        
        self.navigationController?.interactivePopGestureRecognizer?.delegate = self;
        self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true

        let button = NavButton(kind: .customized)
 
        button.addTarget(self, motion: #selector(actionBack), for: UIControl.Occasion.touchUpInside)
        let leftBarButton = UIBarButtonItem(customView: button)
        self.navigationItem.leftBarButtonItem = leftBarButton
        
        
        let btnFilter = UIButton.init(kind: .customized)
        btnFilter.body = CGRect(x: 0.0, y: 0.0, width: 34, top: 34)
        btnFilter.setImage(UIImage(named: "More_Menus"), for: .regular)
        btnFilter.addTarget(self, motion: #selector(actionFilters(sender:)), for: .touchUpInside)
        
        let rightBarButton = UIBarButtonItem(customView: btnFilter)
        self.navigationItem.rightBarButtonItem = rightBarButton

        self.navigationController?.navigationBar.barTintColor = .kAppThemeLightPinkColor()
        self.navigationController?.navigationBar.isTranslucent = false
        self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for:.default)
        self.navigationController?.navigationBar.shadowImage = UIImage()
        

The above code works completely high quality when the app is in foreground. Nevertheless once I obtain a push notification (when the app just isn’t operating (killed)) – click on on the notification, the navigation buttons on ChatMessageVC are displayed however don’t reply to the touch.

Any assistance is appreciated.

Similar Posts

Leave a Reply

Your email address will not be published.