title: Applying a CIFilter to a CALayer
body: <p><a href="https://developer.apple.com/documentation/coreimage/cifilter" rel="nofollow noreferrer">CI Filters</a> are now available in iOS 5, and I'm trying to apply one to a CALayer, <a href="http://www.cocoawithlove.com/2011/05/presenting-mac-dialog-sheet-with-visual.html" rel="nofollow noreferrer">the way you'd do it on Mac</a>. Here's my code: </p>
  
  <pre><code>CALayer *myCircle = [CALayer layer];
  myCircle.bounds = CGRectMake(0,0,30,30);
  myCircle.position = CGPointMake(100,100);
  myCircle.cornerRadius = 15;
  myCircle.borderColor = [UIColor whiteColor].CGColor;
  myCircle.borderWidth = 2;
  myCircle.backgroundColor = [UIColor whiteColor].CGColor;
  
  CIFilter *blurFilter = [CIFilter filterWithName:@"CIDiscBlur"];
  [blurFilter setDefaults];
  [blurFilter setValue:[NSNumber numberWithFloat:5.0f] forKey:@"inputRadius"];
  [myCircle setFilters:[NSArray arrayWithObjects:blurFilter, nil]];
  
  [self.view.layer addSublayer:myCircle];
  </code></pre>
  
  <p>My white circle draws fine, but the filter isn't applied.</p>