title: Draw UIBezierPath outside of UIView::drawRect()?
body: <p>I'm trying to draw a set of small circles around the edge of a view to mirror physical lights (pixels) I'm controlling in my app. These circles will change color frequently. So I've created a PixelSimulator object to draw each circle into a custom UIView object.</p>
  
  <p>Here's the relevant code</p>
  
  <pre><code>class PixelSimulator {
    let size: CGSize;
    let color: UIColor;
    let pixelPath: UIBezierPath;
  
    init (point: CGPoint, size: CGSize, pixel: Pixel) {
      self.point = point;
      self.size = size;
      self.pixel = pixel;
  
      pixelRect = CGRect(origin: point, size: size);
      pixelPath = UIBezierPath(ovalInRect: pixelRect);
  
      color = pixel.color;
    }
  
    func render () {
      UIGraphicsBeginImageContext(size);
  
      color.setFill();
      pixelPath.fill();
  
      UIGraphicsEndImageContext();
    }
  }
  </code></pre>
  
  <p>I've tried a different approach using <code>CGContextAddEllipseInRect(context, pixelRect)</code> to no avail. I've also tried declaring the pixelPath inside of the <code>render()</code> method, also to no avail.</p>
  
  <p>What do I need to change to get my bezierPath drawn onto the screen at any time, inside of <code>drawRect()</code> or out of it?</p>