Sidemenu: how to open this side menu when the button click programmatically in Swift..

Created on 29 Jan 2018  路  4Comments  路  Source: jonkykong/SideMenu

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.

New Issue Checklist


I have read the guidelines for contributing and I understand:

  • [ ] My issue is happening in the latest version of SideMenu.
  • [ ] My issue was not solved in the README.
  • [ ] My issue can not be answered on stackoverflow.com.
  • [ ] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
  • [ ] My issue is reproducible in the demo project.

Issue Description

Failed to complete New Issue Template

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)

All 4 comments

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...

Was this page helpful?
0 / 5 - 0 ratings