title: Draw and Erase Lines with Touch
body: <p>I have a background image (ImageBG) and a foreground image (ImageFG) in separate UIImageViews. They are the same size and, as the name implies, ImageBG is behind ImageFG so you can't see ImageBG. </p>
  
  <p>If the user starts to "draw" on them, instead of a line appearing where the user touches the screen, I want that portion of ImageFG to become transparent and reveal ImageBG. </p>
  
  <p>The closest thing I can think of is a scratch-and-win. </p>
  
  <p>I know how to do the drawing on a graphics context, but when I draw a transparent line (alpha = 0), well... I get a transparent line on top of whatever is currently in my graphics context, so basically nothing is drawn. This is what I use to set the stroke color.</p>
  
  <pre><code>CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1.0, 0.0, 0.0, 0.0)
  </code></pre>
  
  <p>What am I doing wrong? I know this is possible because there are apps out there that do it.</p>
  
  <p>Any hints, tips or direction is appreciated.</p>