Side menu can be dismissed from a tableView only with double tap
kboirel opened this issue · 1 comments
kboirel commented
Describe the bug
(iOS 13.5)
I use SideMenu with a ViewController, and inside of this ViewController I have a TableView.
I would like to dismiss the menu when I click on a tableViewCell, with didSelectRowAt(). When I do that I have to:
- Click on the tableViewCell (of course) -> If I don't do anything, I have to wait maybe 1minute or so to see the menu dismissed
- Click a second time anywhere on the menu (not only on the tableView but really anywhere) -> The menu is dismissed
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("PATH ", indexPath.row)
dismiss(animated: true, completion: nil)
}
- The print() is called when I click on the cell
- If a double tap on the cell, only the first tap call the print()
- If I use the function dismiss with a button outside of tableView, it's working well
EDIT:
With DispatchQueue it's seems to work. But it's maybe not very good to do that?
DispatchQueue.main.async(execute: {
self.dismiss(animated: true, completion: nil)
})
To Reproduce
- Put a tableView inside the UIViewController (which is the sideMenu) (SideTracksMenuViewController: UIViewController for me)
- Try to dismiss the menu with didSelectRowAt()
jonkykong commented
This is not a bug with SideMenu and does not occur in the sample project. This is an issue elsewhere in your code/architecture best suited for stackoverflow.com.