1

I want to use AppNavigationController and AppNavigationDrawerController in the same view, but it is not seen correctly. Thanks

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    FirebaseApp.configure()
    let leftViewController = LeftViewController()
    let root = PatientListController()
    let appToolbarController = AppToolbarController(rootViewController: root)
    let appNavigationController = AppNavigationController(rootViewController: appToolbarController)
    let appNavDrawerController = AppNavigationDrawerController(rootViewController: appNavigationController, leftViewController: leftViewController)
    window = UIWindow(frame: UIScreen.main.bounds)
    window!.rootViewController = appNavDrawerController
    window!.makeKeyAndVisible()


    return true
}

Result

1 Answers1

0

For now I'm using NavigationDrawerController with ToolbarController in the same page. I did my AppDelegate.swift file something like this.

import UIKit
import Material

extension UIStoryboard {
    class func viewController(identifier: String) -> UIViewController {
        return UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: identifier)
    }
}

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        Override point for customization after application launch.

        let appToolbarController = AppToolbarController(rootViewController: DashboardVC())
        let leftNavigationVC = LeftNavigationVC()

        window = UIWindow(frame: Screen.bounds)
        window!.rootViewController = AppNavigationDrawerController(rootViewController: appToolbarController, leftViewController: leftNavigationVC, rightViewController: nil)
        window!.makeKeyAndVisible()

        return true
    }
}

BTW, I'm using Swift 3.

Abduhafiz
  • 3,318
  • 5
  • 38
  • 48