I have a UIViewController
with a custom UINavigationBar
(inherited from it's superclass).
In this controller I am instantiating another UIViewController
and adding it's view as a subview in my view like this:
// I believe this should be 'as LocationPermissionsInfoViewController' but it crashed badly that way. Any ideas?
var permissionsView = UIViewController(nibName:"LocationPermissionsInfoView", bundle: nil) as UIViewController
self.view.addSubview(permissionsView.view)
permissionsView.view.frame = self.view.bounds
The LocationPermissionsInfoView
is designed in IB with various autolayout constraints. However, I want a 'contentView' that exists in that view to respect the Top Layout Guide (the bottom of the custom navigation bar to be precise) of the view it's added on as a subview. Right now, IB obviously only allows me to set up constraints in relation to the top level view in the interface.
Any ideas on how I can achieve this? Ideally from IB or somewhere in LocationPermissionsInfoView
controller.