0

I am using SideMenu pod. While the app is functioning normally I am getting an error of

Failed to set (leftSide) user defined inspected property on (UINavigationController): [<UINavigationController 0x7fa9f7816000> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key leftSide.

In the attribute inspector, I have leftNav set to ON. I am not sure what am I missing here, or what to do with the leftNav key. I do not have any unwanted connections.

    private func setupSideMenu() {

        let lnav = storyboard?.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as? SideMenuNavigationController
        // I set it a second time. lnav?.leftSide = true 
        lnav?.leftSide = true 
        lnav?.statusBarEndAlpha = 0
        lnav?.presentationStyle = .viewSlideOutMenuIn
        lnav?.presentationStyle.backgroundColor = .white
        lnav?.presentationStyle.presentingEndAlpha = 0.5

        // Define the menus
        SideMenuManager.default.leftMenuNavigationController = lnav
        SideMenuManager.default.rightMenuNavigationController = nil

        SideMenuManager.default.addPanGestureToPresent(toView: navigationController!.navigationBar)
        SideMenuManager.default.addScreenEdgePanGesturesToPresent(toView: view, forMenu: .left)
        
    }
Mizal
  • 67
  • 1
  • 8
  • 1
    Maybe it's simply because it's optional? try to unwrap it, i.e. `guard let lnav = storyboard?.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as? SideMenuNavigationController else { return }` – timbre timbre Jan 05 '21 at 14:54

1 Answers1

1

The “this class is not key value coding-compliant” error almost always means that you are trying to set a property of a custom subclass in your storyboard or XIB file in Interface builder, but forgot to change the class of your object to the custom class. It's easy to get this error if you use "user defined runtime attributes" to set properties on your objects, but don't set the class of the object correctly.

I'd have to look at the project - and specifically it's Storyboards/XIB files, to find the problem, but that's very likely what's going on.

Duncan C
  • 128,072
  • 22
  • 173
  • 272