I created a very simple UINavigationController app. Not use IB and only create two files AppDelegate.swift and ViewController.swift. But the results look very weird. Please check the attached image
I use XCode 10.2.1. The simulator's screens can't be filled fully and iphone8 simulator's status bar put the wrong place.
AppDelegate.swift:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.main.bounds)
let homeVC = ViewController(nibName: nil, bundle: nil)
homeVC.title = "HOME"
let nav = UINavigationController(rootViewController: homeVC)
self.window?.rootViewController = nav
self.window?.makeKeyAndVisible()
return true
}
ViewController.swift:
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.yellow
// Do any additional setup after loading the view.
}
What's wrong with me?