title: UIScrollView does not scroll in customView
body: <p>I'm making a custom view and it contains a <code>UIScrollView</code>. But this scroll view does not scroll.</p>
  
  <p>The view hierarchy is as follows:</p>
  
  <pre><code>- mainView
      - UIScrollView
          - contentView
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/enPPq.png" rel="nofollow noreferrer">A picture for illustration purposes</a></p>
  
  <p>Here is my custom view code:</p>
  
  <pre><code>class MyCustomView: UIView {
  
      @IBOutlet var mainView: UIView!
      @IBOutlet weak var scrollView: UIScrollView!
      @IBOutlet weak var scrollViewContetnView: UIView!
  
      // MARK: - Methods
  
      required init?(coder aDecoder: NSCoder) {
          super.init(coder: aDecoder)
          self.customInit()
      }
  
      override init(frame: CGRect) {
          super.init(frame: frame)
          self.customInit()
      }
  
      // MARK: Custom
  
      func customInit() {
          Bundle.main.loadNibNamed("EmoKeyboard", owner: self, options: nil)
          self.addSubview(mainView)
          self.mainView.frame = self.bounds
          self.mainView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
      }
  
      func makeTabItem(count: Int) {
          for i in 0...count {
              let icon = UIButton()
              icon.frame.size = CGSize(width: 28, height: 28)
              icon.center.y = self.scrollViewContentView.center.y
              icon.frame.origin.x = 10 + (CGFloat(i) * 28) + (CGFloat(i) * 10)
              icon.backgroundColor = UIColor.black
  
              self.scrollViewContentView.addSubview(icon)
          }
      }
  
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>