title: Move UIView when UIScrollView scrolls up
body: <p>I am trying to accomplish something similar to this: <a href="https://stackoverflow.com/questions/25374090/move-a-view-when-scrolling-in-uitableview">Move a view when scrolling in UITableView</a> but I want to move also one of the views in the background (not all of them). This is what I've done so far (I use Masonry for the autoLayout): </p>
  
  <pre><code>- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
  
      //There is an array of views, which I want to move when scrolling
  
      for (UIView *view in self.movedViews) {
  
  
          CGFloat offset = scrollView.contentOffset.y;
  
      //Here I get the default Y origin of the view, so I can move them equally
  
          originY = view.frame.origin.y;
          CGFloat diff = (scrollView.contentInset.top)-originY;
  
          [view mas_updateConstraints:^(MASConstraintMaker *make) {
              make.top.mas_equalTo(view.superview.mas_top).with.offset((-offset)-diff);
          }];
      }
  
  }
  </code></pre>
  
  <p>The problem is I can't get <code>view.frame.origin.y</code> without changing it later with <code>mas_updateConstraints</code>. Also I want to make so the views move only when scrolling upwards. I am open to any different solutions. Thank you guys!</p>