title: how to draw vertical line in UIScrollView
body: <p>I have a UIScrollView and I want to draw a vertical line that has a height of the UIScrollView contentHeight. How do I do this easily and without sacrificing performance? I am thinking of using a UIVIew with a very-very large height (because we don't know what the contentHeight of the scrollView will be) and adding it as a subview of the UIScrollView. Is there a better approach than this?</p>
  
  <p>The line is basically 10px width, gray color, that spans from the top to the bottom of the scrollView.</p>
  
  <p>Here's what I have as of now, I am basically overriding the UIScrollView drawRect:</p>
  
  <pre><code>- (void)drawRect:(CGRect)rect
  {
      if (shouldDrawVerticalLineForProfile){
          CGContextRef context = UIGraphicsGetCurrentContext();
          CGColorRef separatorColor = [UIColor colorWithRed:47.0/255.0 green:47.0/255.0 
                                                       blue:47.0/255.0 alpha:1.0].CGColor;
  
          // Add at bottom
          CGPoint startPoint = CGPointMake(30, 0);
          CGPoint endPoint = CGPointMake(30, 10000);
  
          CGContextSaveGState(context);
          CGContextSetLineCap(context, kCGLineCapSquare);
          CGContextSetStrokeColorWithColor(context, separatorColor);
          CGContextSetLineWidth(context, 5.0);
          CGContextMoveToPoint(context, startPoint.x + 0.5, startPoint.y + 0.5);
          CGContextAddLineToPoint(context, endPoint.x + 0.5, endPoint.y + 0.5);
          CGContextStrokePath(context);
          CGContextRestoreGState(context);     
      }
  
  }
  </code></pre>