title: Implementing a custom UIScrollView
body: <p>I'm trying to implement a custom <code>UIView</code> that mimics the behavior of <code>UIScrollView</code> for some reason. And the question is how can I show the proper part of the content which is represented by the <code>contentOffset</code> property?</p>
  
  <p>I've analyzed <code>UIScrollView</code> and found that it doesn't adopt any inbetween sublayers or manipulate the bounds and transform properties to apply the offset. I've overridden the UIView``'s <code>drawRect:</code> method as follows but it didn't work:</p>
  
  <pre><code>- (void)drawRect: (CGRect)rect {
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextTranslateCTM(context, -content_offset_.x, -content_offset_.y);
  }
  </code></pre>
  
  <p>So my question is how does <code>UIScrollView</code> show the proper part of its content? Should I override the layer's display method or else? Any suggestions would be appreciated! And please don't ask 'why do you want to do anything like that in the first place?' :D</p>
  
  <p>Thanks!</p>