I have a custom view that I'm adding to a view controller in viewDidLoad() -
var customView : CustomView = CustomView()
override func viewDidLoad(){
super.viewDidLoad()
self.view.addSubView(customView)
customView.topAnchor.constraint(equalTo : view.safeAreaLayoutGuide.topAnchor).isActive = true //Tried this but nothing happens
}
I have a strange 20px padding on top of the view. I want the custom subview to begin from under the navigation bar. I've tried multiple things but I'm unable to get the 20px top padding to go away. How do I constraint the top of my view to under the navigation bar at all times?