简体   繁体   English

swift 4 中的 SideMenu 功能

[英]SideMenu Functionality in swift 4

I am setting up the side menu by following SideMenu我正在按照SideMenu设置侧面菜单

When the app is loaded first the side menu controller is working fine (.menuslide)当应用程序首先加载时,侧面菜单 controller 工作正常(.menuslide)

but when I come back to the same controller from the side menu to the same view controller or any other controller or any other page it is not following (.menuslide)但是当我从侧面菜单回到相同的 controller 到相同的视图 controller 或任何其他 controller 或任何其他页面时,它没有跟随(.menuslide)

  1. I have tried by assigning the navigation我已经尝试分配导航

    let menu = SideMenuNavigationController(rootViewController: YourViewController) let rightMenuNavigationController = SideMenuNavigationController(rootViewController: YourViewController) SideMenuManager.default.rightMenuNavigationController = rightMenuNavigationController present(menu, animated: true, completion: nil)

through code and also通过代码以及

  1. From the story board从故事板

    I am navigating from every controller to side menu like this我从每个 controller 导航到像这样的侧面菜单

     let navigationController = storyboard.:instantiateViewController(withIdentifier, "sidemenunavigation") as: SideMenuNavigationController present(navigationController, animated: true completion nil)

for the first time after loading it is navigating properly (.menuslide)加载后第一次正确导航(.menuslide)

but after navigating to other controller and get the side menu it is not following (.menuslide)但是在导航到其他 controller 并获得它没有跟随的侧面菜单后(.menuslide)

you may use the following RESideMenu for side menu quite easy to use RESideMenu for side menu您可以将以下 RESideMenu 用于侧边菜单 非常容易将RESideMenu 用于侧边菜单

please check this code is working fine for navigation another view controller for sidemenu请检查此代码是否适用于导航另一个视图 controller 用于侧面菜单

let storyBoard = UIStoryboard(name:"Main", bundle: nil) if let conVC = storyBoard.instantiateViewController(withIdentifier: "RoutingAddViewController") as? RoutingAddViewController, let navController = UIApplication.shared.keyWindow?.rootViewController as? UINavigationController { navController.pushViewController(conVC, animated: true) }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM