title: UIScrollView frame y coordinate goes 20 pixels up when content is updated
body: <p>Original view, at top position:<br>
  <img src="https://i.stack.imgur.com/xPjopm.png" alt="enter image description here"></p>
  
  <p>View after new content has been added, at top position (The view moved 20 pixels upwards)<br>
  <img src="https://i.stack.imgur.com/rA8cXm.png" alt="enter image description here"></p>
  
  <p>View after scrolling a little extra to the top (Like when you refresh pulling the content down)<br>
  <img src="https://i.stack.imgur.com/7pNsJm.png" alt="enter image description here"></p>
  
  <p>So when I add a new view inside this view and update the sizes and everything to make it look correct, I still have an unsolvable thing. Which makes the scrollview start from 20 pixels above the normal point in y axis. </p>
  
  <p>I tried fixing this with adding +20 pixels to the scrollView frame. It works ok when I make only 1 update, if I make several updates now the scrollView starts a lot of pixels below of where it actually should start. I tried this with locking the +20 addition to only happen on the first time, it didn't work. Plus the scrollview messes up completely in new views too.</p>
  
  <p>I don't have storyboard or xib. The project is full programmatically developed. </p>
  
  <p>By the way I checked every variable in scollView, self.view, cardView that I could think of that would affect this. The problem is none of their frame variables are changing in any way. But they act like something changed and I just couldn't figure out what.</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
      self.automaticallyAdjustsScrollViewInsets = false
  
      navigationController?.navigationBar.hidden = false
  
      createScrollView()
  }
  </code></pre>
  
  <p>//How I created the SV in viewdidload</p>
  
  <pre><code>func createScrollView() {
      scrollView.frame = self.view.frame
      scrollView.showsVerticalScrollIndicator = true
      scrollView.scrollEnabled = true
      scrollView.userInteractionEnabled = true
      scrollView.delegate = self
      scrollView.sizeToFit()
      scrollView.contentSize = CGSize(width: cardWidth, height: 100)
      view.addSubview(scrollView)
  }
  </code></pre>
  
  <p>//How I create a view inside my scrollview  </p>
  
  <pre><code>func makeNewCard() {
      var newCard = CardView()
      newCard.createCard(sender: self)
  
      gestureRecognizer = UIPanGestureRecognizer(target: self, action: Selector("cardWasDragged:"))
      gestureRecognizer.delegate = self
      newCard.addGestureRecognizer(gestureRecognizer)
  
      scrollView.contentSize = CGSize(width: cardWidth, height: newCard.frame.height + CGFloat(50 + 64))
      scrollView.addSubview(currentCardView)
  }
  </code></pre>
  
  <p>//Creating my view inside another View class</p>
  
  <pre><code>func createCard(#sender: CardVC) {
      frame = CGRect(x: ScreenWidth/15, y: 64, width: cardWidth, height: cardHeight)
      contentMode = UIViewContentMode.ScaleAspectFit
      userInteractionEnabled = true
  }
  </code></pre>
  
  <p>//Adding about 20-50 pixels of new content in the view</p>
  
  <pre><code>func newContent() {
      var extraHeight = newHeight
  
      frame = CGRect(x: ScreenWidth/15, y: 64, width: cardWidth, height: frame.height + extraHeight)
  
      senderView.scrollView.contentSize = CGSize(width: cardWidth, height: senderView.scrollView.contentSize.height + extraHeight - 20) //Had to put -20, I guess I will remove the -20 after this is fixed     
  }
  </code></pre>