ViewController covered up by NavigationBar
My view is going under the navigation bar. Most of the view is showing, except the top part which is covered up by the Nav bar. How do I prevent that?
self.navigationController.navigationBar.isTranslucent = false
You must set the anchor to safeAreaLayoutGuide like this:
NSLayoutConstraint.activate([ myView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor) ])
same thing for bottom if you have a tabbar:
NSLayoutConstraint.activate([ myView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor) ])
Also, remember to set
.translatesAutoresizingMaskIntoConstraints = falseon "myView"