To Manage RTL and LTR without closing application Swift 3.0.
//RTL
UIView.appearance().semanticContentAttribute = .forceRightToLeft
UINavigationBar.appearance().semanticContentAttribute = .forceRightToLeft
//applicationNavigationController is Application Default Navigation Controller
if let applicationNavigationController = storyboard?.instantiateViewController(withIdentifier: "root") {
UIApplication.shared.keyWindow?.rootViewController = applicationNavigationController
LTR//
UIView.appearance().semanticContentAttribute = .forceLeftToRight
UINavigationBar.appearance().semanticContentAttribute = .forceLeftToRight
if let applicationNavigationController = storyboard?.instantiateViewController(withIdentifier: "root") {
UIApplication.shared.keyWindow?.rootViewController = applicationNavigationController
// Additional Tips while a deal with MMDrawer.
AppDelegate
var centerContainer:MMDrawerController?
Implement MMDrawer Code inside one ViewController.
let appdelegate=UIApplication.shared.delegate as! AppDelegate
let mainStoryboard:UIStoryboard=UIStoryboard(name: "Main", bundle: nil)
let centerViewController = mainStoryboard.instantiateViewController(withIdentifier: "HomeViewController") as! HomeViewController
let leftViewController = mainStoryboard.instantiateViewController(withIdentifier: "LeftSideMenuViewController") as! LeftSideMenuViewController
let leftSideNav = UINavigationController(rootViewController: leftViewController)
let centerNav = UINavigationController(rootViewController: centerViewController)
appdelegate.centerContainer = MMDrawerController(center: centerNav, leftDrawerViewController: leftSideNav)
appdelegate.centerContainer?.maximumLeftDrawerWidth = 250.0
appdelegate.centerContainer!.openDrawerGestureModeMask = MMOpenDrawerGestureMode.panningCenterView
appdelegate.centerContainer!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.all
//////////
self.navigationController?.pushViewController(appdelegate.centerContainer!, animated: false)