title: Swift: UIScrollView & UIControl - addTarget | addGestureRecognizer - Not working as expected
body: <p>I am working with <code>UIScrollView</code> and <code>UIStackView</code> to scroll horizontally and select a <code>UIControl</code> element.</p>
  
  <p>I have addTarget set on a <code>UIControl</code> element as follows inside a <code>UIStackView</code>:
  <br>i.e <code>HighlightColorView</code> is of type <code>UIControl</code></p>
  
  <pre><code>lazy var colorsStackView: UIStackView = {
          let stackView = UIStackView()
          stackView.axis = .horizontal
          stackView.distribution = .fillEqually
          stackView.isUserInteractionEnabled = true
          stackView.alignment = .center
          stackView.spacing = 12
          stackView.translatesAutoresizingMaskIntoConstraints = false
          stackView.isUserInteractionEnabled = true
          for color in colors {
              let colorView = HighlightColorView()
              colorView.backgroundColor = color
              colorView.addTarget(self, action: #selector(self.handleColorTap(_:)), for: .touchUpInside)
              stackView.addArrangedSubview(colorView)
          }
          return stackView
      }()
  
  @objc func handleColorTap(_ sender: UIView) {
          highlightSelectionDelegate.didTapColor(colorView: sender, mainView: self)
          let viewBackgroundColor = sender.backgroundColor ?? .black
          print("", viewBackgroundColor)
      }
  </code></pre>
  
  <p>The issue is that when you tap on a <code>colorView</code> which is of type <code>UIControl</code> the tap doesn't work as expected. There seems to be a freeze and it only works when the view is dismissed.
  <br>Basically you tap on a color and nothing happens then when you dismiss the view then the tap registers and starts working. 
  It seems to be an issue with the scrollView but I am not sure.</p>
  
  <p>Implementation of the <code>scrollView</code>:</p>
  
  <pre><code>lazy var scrollView: UIScrollView = {
          let scView = UIScrollView()
          scView.contentInset = UIEdgeInsets(top: 0, left: 12, bottom: 0, right: 12)
          scView.showsHorizontalScrollIndicator = false
          scView.translatesAutoresizingMaskIntoConstraints = false
          scView.isUserInteractionEnabled = true
          scView.delaysContentTouches = false
          return scView
      }()
  </code></pre>
  
  <p>The use case it to be able to scroll on colors and tap them to highlight a text.</p>