I have a problem with my navigationbar. I go to the "audio" viewcontroller, if I go back, I can't click on my navigationbar button menu and "?".
I test on an iOS 10, iOS 11 and iOS 12 device on simulator, there is no problem. I know that there are changes with navigationbar with iOS13.
The code to add my navigationbar and the menu button:
let navBar = UINavigationBar()
// Default attributes
navBar.tintColor = MixedColors.clearWhiteColor()
navBar.isTranslucent = false
navBar.layer.elevate(elevation: 3)
navBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:MixedColors.clearWhiteColor()]
self.btnNetwork.alpha = 0
navBar.items = [UINavigationItem()]
// Ajout du boutton menu
let frame = CGRect(x: 0, y: 0, width: 25, height: 45)
self.btnMenu = UIView(frame: frame)
let imgView = UIImageView(frame: frame)
imgView.image = UIImage(named: "ic_menu")
imgView.contentMode = .scaleAspectFit
imgView.withColor(color: MixedColors.clearWhiteColor())
self.btnMenu.addSubview(imgView)
// Actions sur le menu
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.open))
self.btnMenu.isUserInteractionEnabled = true
self.btnMenu.addGestureRecognizer(tapGesture)
var leftButtonItems: [UIBarButtonItem] = []
let btn = UIBarButtonItem(customView: self.btnMenu)
btn.accessibilityIdentifier = "MenuBtn"
leftButtonItems.append(btn)
leftButtonItems.append(UIBarButtonItem(title: (self.title_bar), style: UIBarButtonItem.Style.plain, target: nil, action: #selector(self.open)))
navBar.items?.first?.setLeftBarButtonItems(leftButtonItems, animated: false)
The code to add "?" button:
guard let navigationBar = SAppState.sInst.navigationBar else { return }
let helpButton = UIBarButtonItem(image: UIImage(named: "ic_help_outline_white"), style: .plain, target: self, action: #selector(self.presentHelper))
navigationBar.items?[0].rightBarButtonItems = [helpButton]
SAppState.sInst.navigationBar = navigationBar