title: How to set views once after viewdidload or navigationBar is set?
body: <p>I've got a viewController thats being pushed onto the stack by a navigationController. In this viewController, I have a function called setupViews that adds my UI elements to the view and anchors them according to the bottomAnchor of the navigationBar. </p>
  
  <p>Example:</p>
  
  <pre><code>func setupViews() {
      view.addSubview(topBar)
      topBar.anchor(top: navigationController?.navigationBar.bottomAnchor, left: view.leftAnchor, bottom: nil, right: view.rightAnchor, paddingTop: 1, paddingLeft: 0, paddingBottom: 0, paddingRight: 0, width: 0, height: 55)
  }
  </code></pre>
  
  <p>I want to call setupViews() in viewDidLoad() but at this point, the navigationController's navigationBar is not set. So I'm calling setupViews in viewDidAppear which is undesirable since the views reload every time the ViewController appears. </p>
  
  <p>Is there a function I can call setupViews in that runs only once, after the navigationBar is set? I was thinking about creating a navigationBar optional with a didSet and calling setupViews in that, but I'm not sure if this will solve the issue.</p>