devxoul / URLNavigator

⛵️ Elegant URL Routing for Swift
MIT License
3.26k stars 297 forks source link

can't worked if use navigationdrawercontroller #76

Open liuliangjia opened 7 years ago

liuliangjia commented 7 years ago
    let leftViewController = SecondViewController()
    let appBottomNavigationController = AppBottomNavigationController(viewControllers: [navHome,navTeachingResearch,navSignUp,navStudio,navMicroClass])
    window!.rootViewController = AppBottomNavigationController(viewControllers: [navHome,navTeachingResearch,navSignUp,navStudio,navMicroClass])    //success
    //window!.rootViewController = AppNavigationDrawerController(rootViewController: appBottomNavigationController, leftViewController: leftViewController)     //can't worked,push
    window!.makeKeyAndVisible()
    URLNavigationMap.initialize()
devxoul commented 7 years ago

What is AppNavigationDrawerController?

liuliangjia commented 7 years ago

https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/NavigationDrawerController

devxoul commented 7 years ago
class AppNavigationDrawerController: NavigationDrawerController

What is NavigationDrawerController here?

liuliangjia commented 7 years ago

display a drawer layout, like this

https://camo.githubusercontent.com/c03eb5c82e0ada061674b23ab8a4b445d7eb30f4/687474703a2f2f7777772e636f736d69636d696e642e636f6d2f6d6174657269616c2f7368617265642f6e617669676174696f6e2d6472617765722d636f6e74726f6c6c65722e676966

devxoul commented 7 years ago

I mean, where is the implementation of NavigationDrawerController?

liuliangjia commented 7 years ago

1.AppNavigationDrawerController.swift

class AppNavigationDrawerController: NavigationDrawerController {
    open override func prepare() {
        super.prepare()

        delegate = self
        Application.statusBarStyle = .default
    }
}

2.use AppNavigationDrawerController in AppDelegate.swift:

        window!.rootViewController = AppNavigationDrawerController(rootViewController: appToolbarController, leftViewController: leftViewController)
        window!.makeKeyAndVisible()

3.NavigationDrawerController is a component in https://github.com/CosmicMind/Material

sorry my english is bad......