I need to open this side menu when the button click in the , i tried so much of way to open this side menu. but now one should open this please tell if is there any one of the way to open the side menu programmatically in swift.
I have read the guidelines for contributing and I understand:
Please read the README.
i read it fully, i cannot understand, for example i have a custom leftBarButtonItem and add a target for this button , inside of the target button function how to open the SideMenuManager.?
let button1 = UIButton(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
button1.addTarget(self, action: #selector(menu_btn_selector), for: .touchUpInside)
self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: viewFN)
// Function called
@objc func menu_btn_selector(){
print("left nav item select and tell how i should open the side menu programmatically")
}
Normally the pan gesture was opened to view. but how i should open the side menu programmatically when the button clicked. please tell me ,
@HariNarayanan777 you have to present your UISideMenuNavigationController programmatically.
let sideMenuNC = self.storyboard?.instantiateViewController(withIdentifier: <Storyboard id of UISideMenuNavigationController>)
self.present(sideMenuNC!, animated: true, completion: nil)
Super awesome its working...
Most helpful comment
@HariNarayanan777 you have to present your UISideMenuNavigationController programmatically.
let sideMenuNC = self.storyboard?.instantiateViewController(withIdentifier: <Storyboard id of UISideMenuNavigationController>) self.present(sideMenuNC!, animated: true, completion: nil)