swiftxcode11.3ios13.2

Bars not showing on iOS 13 using Xcode 11.3


UITabBar not showing on iOS 13.2

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

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

        window = UIWindow(frame: UIScreen.main.bounds)
        let rootViewController = UITabBarController()
        rootViewController.viewControllers = [RecordController()]
        window?.rootViewController = rootViewController
        window?.makeKeyAndVisible()

        return true
    }
}

and UINavigationBar not showing on iOS 13.2

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

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

        window = UIWindow(frame: UIScreen.main.bounds)
        window?.rootViewController = UINavigationController(rootViewController: RecordController())
        window?.makeKeyAndVisible()

        return true
    }
}

This works perfectly on iOS 12 and older


Solution

  • you need to replace your code in Scene Delegate if your using 13.2. if there is no scene delegate in your xcode then use this condition in didFinishLaunchingWithOptions delegate.

    Hope it will work for you. Thanks

        if #available(iOS 13, *) {
            return //code for ios 13
        } else {
            return // code for ios 12 or lower version
        }