Simulator not showing any output

56 views Asked by At

when I integrate cocoapods I'm getting an error in the simulator. Although my simulator is working when I work without integrating cocoapods..when I run my code on the simulator, it is not showing any output, this is the Screenshotof the simulator as well as breakpoint result

AppDelegate.swift

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
    {
        GMSServices.provideAPIKey("gasdgsdsjbnksdfkdf")
        GMSPlacesClient.provideAPIKey("shgdsgfskdakdjadj")

        self.window = UIWindow(frame: UIScreen.main.bounds)
        if let window = self.window {
            window.backgroundColor = UIColor.white

            let nav = UINavigationController()
            let mainView = ViewController()
            nav.viewControllers = [mainView]
            window.rootViewController = nav
            window.makeKeyAndVisible()
       }
        return true
    }
1

There are 1 answers

0
Viren Malhan On
let mainView = ViewController()

This is not the proper way to initialise your view controller from storyboard.

Use

UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "<"Your storyboard id">") as? ViewController