In my AppDelegate.swift
-class I added the following:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.navController.pushViewController(rootViewController, animated: false)
self.createSlideOutMenu(navController, rearViewController: menuViewController)
self.window?.makeKeyAndVisible()
return true
}
and the method:
func createSlideOutMenu(frontViewController: UIViewController, rearViewController: UIViewController) {
// create instance of swRevealViewController based on frontViewController and rearViewController
let swRevealViewController = SWRevealViewController(rearViewController: rearViewController, frontViewController: frontViewController)
swRevealViewController.toggleAnimationType = SWRevealToggleAnimationType.EaseOut
swRevealViewController.toggleAnimationDuration = 0.3
// change background color
swRevealViewController.frontViewController.view.backgroundColor = UIColor.whiteColor()
swRevealViewController.rearViewController.view.backgroundColor = UIColor.whiteColor()
// set swRevealViewController as rootViewController of windows
self.window?.rootViewController = swRevealViewController
}
When I switch to a new ViewController the background is always black. I tried to change to color in the navController
but nothing happened. How can the background color of the ViewControllers can be change to i.e. white?