I am making a basic Minesweeper app for practice / fun in swift. I want to make it so the size of the board (10 tiles wide) adapts to any iOS screen.
To do this I\'m se
While the accepted answers is a correct answer I thought I might at least say that you can force the view to draw itself before hitting viewDidAppear:.
Either, you can in your viewDidLoad: call:
view.setNeedsLayout()
view.layoutIfNeeded()
Or if you create it from "outside":
let vc = UIViewController()
let _ = vc.view
or
let vc = UIViewController()
vc.view.setNeedsLayout()
vc.view.layoutIfNeeded()