kukushi / SideMenu

An interactive iOS side menu with rich features.
MIT License
776 stars 124 forks source link

Open particular page in App delgate #109

Open shaikhmoin opened 4 years ago

shaikhmoin commented 4 years ago

I want to set default page into App delegate method,I write code but its not properly working.My code like below,

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

       let contentViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ContentNavigation");
       let contentReportController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ContentNavigationCurrency");
       let menuViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SideBar")

   if isMultyCurrency == "1" {

         window = UIWindow(frame: UIScreen.main.bounds)
         window?.rootViewController = SideMenuController(contentViewController:contentViewController,menuViewController:menuViewController)
         window?.makeKeyAndVisible()

   } else {
         window = UIWindow(frame: UIScreen.main.bounds)
         window?.rootViewController = SideMenuController(contentViewController:contentReportController,menuViewController:menuViewController)
         window?.makeKeyAndVisible()
        }
   return true
  }
kukushi commented 4 years ago

@shaikhmoin Your code seems correct.