title: Swift - Get frames of view when auto layout is used
body: <p>In my view that is used as a sub view in a view controller, I defined differents components using auto layout. However, within my sub view, I need to access the frames of the components.</p>
  <p>Here is my code:</p>
  <pre><code>class CreateChallengeView: AbstractCreateChallengeOrTournamentView {
     override init(frame: CGRect) {
         super.init(frame: frame)
      
        setupView(frame: frame)
    }
  
   private func setupView(frame:CGRect) {
  
       setNeedsLayout()
  
      /* START SCROLL VIEW */
      scrollView = UIScrollView()
      scrollView.translatesAutoresizingMaskIntoConstraints = false
      addSubview(scrollView)
      
      scrollView.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: frame.width * (22 / IPHONE8_SCREEN_WIDTH)).isActive = true
      scrollView.widthAnchor.constraint(equalToConstant: frame.width * (331 / IPHONE8_SCREEN_WIDTH)).isActive = true
      scrollView.topAnchor.constraint(equalTo:self.topAnchor).isActive = true
      scrollView.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true
      /* END SCROLL VIEW */
      
      /* START CONTAINER VIEW */
      containerView = UIView()
      containerView.translatesAutoresizingMaskIntoConstraints = false
      scrollView.addSubview(containerView)
      
      containerView.leadingAnchor.constraint(equalTo: self.scrollView.leadingAnchor).isActive = true
      containerView.widthAnchor.constraint(equalTo: self.scrollView.widthAnchor).isActive = true
      containerView.topAnchor.constraint(equalTo: self.scrollView.topAnchor).isActive = true
      containerView.bottomAnchor.constraint(equalTo: self.scrollView.bottomAnchor).isActive = true
      
      containerView.layer.borderColor = UIColor.black.cgColor
      containerView.layer.borderWidth = 2
      /* END CONTAINER VIEW */
      
      /* START TITLE LABEL*/
      titleLabel.translatesAutoresizingMaskIntoConstraints = false
      self.containerView.addSubview(titleLabel)
      
      titleLabel.leadingAnchor.constraint(equalTo: self.containerView.leadingAnchor, constant: frame.height * (19 / IPHONE8_SCREEN_HEIGHT)).isActive = true
      titleLabel.widthAnchor.constraint(equalToConstant: frame.width * (284 / IPHONE8_SCREEN_WIDTH)).isActive = true
      titleLabel.topAnchor.constraint(equalTo: self.containerView.topAnchor, constant: frame.height * (11 / IPHONE8_SCREEN_HEIGHT)).isActive = true
      titleLabel.heightAnchor.constraint(equalToConstant: frame.height * (27 / IPHONE8_SCREEN_HEIGHT)).isActive = true
      titleLabel.text = NSLocalizedString(CHALLENGE_NAME_TEXT, comment: &quot;&quot;)
      print(titleLabel.frame) --&gt; (0,0,0,0) How to get frame?
      /* END TITLE LABEL */
  </code></pre>
  <p>How do I get the frames directly of my <strong>titleLabel</strong> as an example?</p>