单击时,KYDrawerController的侧菜单无响应

时间:2019-02-18 05:02:19

标签: xcode

当我从小部件(今天扩展名)单击时,KYDrawerController的侧菜单没有响应。但是当我直接从应用程序图标单击时,它可以工作。下面是我的代码。

func addDrawerMenuButton(){         self.navigationItem.leftBarButtonItem = UIBarButtonItem(图片:UIImage.menuImage(),样式:.plain,目标:自我,行动​​:#selector(self.drawerMenuButtonTapped))     }

@objc func drawerMenuButtonTapped() {
    if let drawerController = self.navigationController?.parent as? KYDrawerController {
        drawerController.setDrawerState(.opened, animated: true)

    } else if let drawerController = self.navigationController?.presentingViewController as? KYDrawerController {
        drawerController.setDrawerState(.opened, animated: true)

    }
}

0 个答案:

没有答案