Closed XinwenCheng closed 8 years ago
OK, I got it. Need to use following code by myself.
self.sideMenuController()?.sideMenu?.hideSideMenu()
Where did you put this code? I need this
To instance an ENSideMenu like following,
sideMenu = ENSideMenu(sourceView: self.view, menuViewController: LeftSideNavigationMenuViewController(), menuPosition: .Left)
There's LeftSideNavigationMenuViewController which contains table view of navigation items, and in its override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) function, I put following code,
if indexPath.row == selectedMenuItem {
self.sideMenuController()?.sideMenu?.hideSideMenu()
return
}
selectedMenuItem = indexPath.row
Hope this helps!
Thank you very much!!
Hi @evnaz ,
When I click the current menu item, how can I make the side menu collapse automatically?
Thanks!