Skip to content

Instantly share code, notes, and snippets.

@ashour
Created June 18, 2019 10:20
Show Gist options
  • Save ashour/5907c486f52d66b0b6ccd27de8f4ff37 to your computer and use it in GitHub Desktop.
Save ashour/5907c486f52d66b0b6ccd27de8f4ff37 to your computer and use it in GitHub Desktop.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
OTATranslations.shared.updateTranslations() {
AppDelegate.reloadRootViewController()
}
return true
}
static func reloadRootViewController() {
DispatchQueue.main.async {
let storyboard = UIStoryboard.init(name: "Main", bundle: nil)
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.rootViewController =
storyboard.instantiateInitialViewController()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment