title: UIView subviews not appearing
body: <p>I have a view controller with a <code>UIView</code>. Inside that <code>UIView</code> I add elements like a text label. When I run my code it is not there.</p>
  
  <pre><code>import UIKit
  
   class EventDetailViewController: UIViewController {
  
  //variables that will hold data sent in through previous event controller
  var eventImage = ""
  var eventName = ""
  var eventDescription = ""
  var eventStreet = ""
  var eventCity = ""
  var eventState = ""
  var eventZip = 0
  var eventDate = ""
  //
  lazy var currentEventImage : UIImageView = {
      let currentEvent = UIImageView()
      let imageURL = URL(string: self.eventImage)
      currentEvent.af_setImage(withURL: imageURL!)
      currentEvent.clipsToBounds = true
      currentEvent.translatesAutoresizingMaskIntoConstraints = false
      currentEvent.contentMode = .scaleToFill
      currentEvent.layer.masksToBounds = true
      return currentEvent
  }()
  //will be responsible for creating the UIView that contains relevant event information
  let eventInfoContainerView: UIView = {
     let infoContainer = UIView()
      infoContainer.backgroundColor = UIColor.white
      infoContainer.layer.masksToBounds = true
      return infoContainer
  }()
  
  lazy var eventNameLabel: UILabel = {
      let currentEventName = UILabel()
      currentEventName.text = self.eventName
      currentEventName.translatesAutoresizingMaskIntoConstraints = false
      return currentEventName
  }()
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
   view.backgroundColor = UIColor.white
      navigationItem.title = eventName
      self.navigationItem.hidesBackButton = true
      let backButton = UIBarButtonItem(image: UIImage(named: "icons8-Back-64"), style: .plain, target: self, action: #selector(GoBack))
      self.navigationItem.leftBarButtonItem = backButton
  
      //Subviews will be added here
      view.addSubview(currentEventImage)
      view.addSubview(eventInfoContainerView)
      eventInfoContainerView.addSubview(eventNameLabel)
      //Constraints will be added here
      _ = currentEventImage.anchor(view.centerYAnchor, left: nil, bottom: nil, right: nil, topConstant: -305, leftConstant: 0, bottomConstant: 0, rightConstant: 0, widthConstant: self.view.frame.width, heightConstant: 200)
      _ = eventInfoContainerView.anchor(currentEventImage.bottomAnchor, left: view.leftAnchor, bottom: view.bottomAnchor, right: view.rightAnchor, topConstant: 0, leftConstant: 0, bottomConstant: 0, rightConstant: 0, widthConstant: 0, heightConstant: 0)
       _ = eventNameLabel.anchor(eventInfoContainerView.bottomAnchor, left: view.leftAnchor, bottom: nil, right: nil, topConstant: 20, leftConstant: 32, bottomConstant: 0, rightConstant: 0, widthConstant: 0, heightConstant: 0)
  
  
  
  }
  
  func GoBack(){
   _ = self.navigationController?.popViewController(animated: true)
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
   }
  </code></pre>
  
  <p>I am kind of lost I viewed a tutorial where they added elements to a <code>UIView</code> in a similar fashion and things appeared. Any insight would be helpful. Tried changing multiple things and nothing really made it appear and I have researched a couple answers I know it is probably something small that my eyes are just looking past but I can't discover it at this point.</p>
  
  <p>This is my custom method for setting constraints</p>
  
  <pre><code> import UIKit
  
  
  extension UIView {
  
  func anchorToTop(_ top: NSLayoutYAxisAnchor? = nil, left: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, right: NSLayoutXAxisAnchor? = nil) {
  
      anchorWithConstantsToTop(top, left: left, bottom: bottom, right: right, topConstant: 0, leftConstant: 0, bottomConstant: 0, rightConstant: 0)
  }
  
  func anchorWithConstantsToTop(_ top: NSLayoutYAxisAnchor? = nil, left: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, right: NSLayoutXAxisAnchor? = nil, topConstant: CGFloat = 0, leftConstant: CGFloat = 0, bottomConstant: CGFloat = 0, rightConstant: CGFloat = 0) {
  
      translatesAutoresizingMaskIntoConstraints = false
  
      if let top = top {
          topAnchor.constraint(equalTo: top, constant: topConstant).isActive = true
      }
  
      if let bottom = bottom {
          bottomAnchor.constraint(equalTo: bottom, constant: -bottomConstant).isActive = true
      }
  
      if let left = left {
          leftAnchor.constraint(equalTo: left, constant: leftConstant).isActive = true
      }
  
      if let right = right {
          rightAnchor.constraint(equalTo: right, constant: -rightConstant).isActive = true
      }
  
  }
  
  
  func anchor(_ top: NSLayoutYAxisAnchor? = nil, left: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, right: NSLayoutXAxisAnchor? = nil, topConstant: CGFloat = 0, leftConstant: CGFloat = 0, bottomConstant: CGFloat = 0, rightConstant: CGFloat = 0, widthConstant: CGFloat = 0, heightConstant: CGFloat = 0) -&gt; [NSLayoutConstraint] {
      translatesAutoresizingMaskIntoConstraints = false
  
      var anchors = [NSLayoutConstraint]()
  
      if let top = top {
          anchors.append(topAnchor.constraint(equalTo: top, constant: topConstant))
      }
  
      if let left = left {
          anchors.append(leftAnchor.constraint(equalTo: left, constant: leftConstant))
      }
  
      if let bottom = bottom {
          anchors.append(bottomAnchor.constraint(equalTo: bottom, constant: -bottomConstant))
      }
  
      if let right = right {
          anchors.append(rightAnchor.constraint(equalTo: right, constant: -rightConstant))
      }
  
      if widthConstant &gt; 0 {
          anchors.append(widthAnchor.constraint(equalToConstant: widthConstant))
      }
  
      if heightConstant &gt; 0 {
          anchors.append(heightAnchor.constraint(equalToConstant: heightConstant))
      }
  
      anchors.forEach({$0.isActive = true})
  
      return anchors
  }
  
  }
  </code></pre>