2

I’m using left side menu from jonkykong/SideMenu this framework. Here i need to change background view colour alpha value while open(means click on button) the side menu and when i close the side menu i need back the original background colour. for that I have tried two methods:

Method 1):

  func sidemenuOpenCloseColorChang(){

    let menu = storyboard!.instantiateViewController(withIdentifier: "UISideMenuNavigationController") as! UISideMenuNavigationController
    var set = SideMenuSettings()
    set.statusBarEndAlpha = 0
    set.presentationStyle = SideMenuPresentationStyle.menuSlideIn
    set.presentationStyle.presentingEndAlpha = 0.5

    set.menuWidth = min(view.frame.width, view.frame.height) * 0.90
    //menu.sideMenuManager.addScreenEdgePanGesturesToPresent(toView: self.view)
    menu.settings = set
    //SideMenuManager.default.addScreenEdgePanGesturesToPresent(toView: view)
    SideMenuManager.default.leftMenuNavigationController = menu
}

getting below error:

Use of unresolved identifier 'SideMenuSettings'

Use of unresolved identifier 'SideMenuPresentationStyle'

Value of type 'SideMenuManager' has no member 'leftMenuNavigationController'

Method 2): using UISideMenuNavigationControllerDelegate Metod

@IBAction func sideMenubtn(_ sender: Any) {
    view?.backgroundColor = UIColor(white: 1, alpha: 0.9)
}

extension ProfileViewController : UISideMenuNavigationControllerDelegate {
private func sideMenuWillDisappear(menu: UISideMenuNavigationControllerDelegate, animated: Bool) {
//*do the color thing*
    print("sidemenu disappear")
view?.backgroundColor = UIColor.white
}

Nothing worked for me, please help me in this code. Thanks in advance

Community
  • 1
  • 1
Swift
  • 1,074
  • 12
  • 46
  • It seems to me like you didn't properly import your SideMenu dependency. Your compiler isn't recognizing `SideMenuSettings`, and it's saying that `SideMenuManager` doesn't have a property called `leftMenuNavigationController`. It's hard to do much with this without seeing your project setup. – Pierce Dec 29 '19 at 18:47
  • which library used for sideMenu? – Jayraj Vala Dec 30 '19 at 06:13

0 Answers0