Can’t Add new Views after declaring RootViewController

I recently started developing iOS apps in swift and I’m trying to make an iBeacon App using this tutorial.

I want to Embed the ViewController in a navigationController, but I don’t know what should I change in this lines of code:

let viewController:ViewController = window!.rootViewController as ViewController
viewController.beacons = beacons as CLBeacon[]?
viewController.tableView.reloadData()

As the RootViewController is no longer the ViewController.

Note: The code is in the AppDelegate.


Source: ios

Leave a Reply