Closed FredvanRijswijk closed 7 years ago
You can simply close the menu by calling DropDownTitleView.toggleMenu()
when the checked item changes and the menu is opened.
In the project example, this could be done by calling toggleMenu()
in the choose action of the ViewController:
@IBAction func choose(_ sender: AnyObject) {
titleView.title = (sender as! DropDownMenuCell).textLabel!.text
if titleView.isUp {
titleView.toggleMenu()
}
}
thnx! I was forgotten
if titleView.isUp
so it was crashing before, no it's working perfect
I could improve the example to avoid the check titleView.isUp
.
In fact, it's surely better to avoid calling selectMenuCell(_:)
in prepareNavigationBarMenu()
and simply do secondCell.accessoryType = .checkmark
.
Hi,
Where it's best to close the DropDownMenu when you have selected a item Cell? Now you have to select the titleView or the Menubackground