我正在使用 MMDrawerController 在我的 ios 应用程序中创建一个侧边栏,我已经成功实现了它,但是我试图在侧边栏显示时减少中心视图的 alpha,正如您通常在大多数具有类似功能的应用程序上看到的那样,但是我我收到错误
Type of expression is ambiguius without more context
这是我的 AppDelegate 中的代码,visualstateblock 部分正在抛出错误
func buildNavigationDrawer()
{
// Instantiate Main.storyboard
let mainStoryBoard:UIStoryboard = UIStoryboard(name:"Main", bundle:nil)
// Create View Controllers
let mainPage:TabBarViewController = mainStoryBoard.instantiateViewController(withIdentifier: "TabBarViewController") as! TabBarViewController
let rightSideMenu:HomeSideMenuViewController = mainStoryBoard.instantiateViewController(withIdentifier: "HomeSideMenuViewController") as! HomeSideMenuViewController
// Wrap into Navigation controllers
let rightSideMenuNav = UINavigationController(rootViewController:rightSideMenu)
// Cerate MMDrawerController
drawerContainer = MMDrawerController(center: mainPage, rightDrawerViewController: rightSideMenuNav)
//drawerContainer!.openDrawerGestureModeMask = MMOpenDrawerGestureMode.PanningCenterView
drawerContainer!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.panningCenterView
drawerContainer!.setDrawerVisualStateBlock { (drawerContainer, rightSideMenuNav) in
drawerContainer!.centerViewController.view.alpha = 0.3;
}
// Assign MMDrawerController to our window's root ViewController
window?.rootViewController = drawerContainer
}
谢谢你的帮助