title: iOS Swift - Sketch style Gaussian blur effect in swift 3
body: <p>I'm new to Swift. I have created blurred UI in Sketch using Gaussian blur effect:</p>
  
  <p><a href="https://i.stack.imgur.com/qtouv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qtouv.jpg" alt="enter image description here"></a></p>
  
  <p>Now I want to implement this effect in UIImageView.</p>
  
  <p>It is possible to use visual effect with blur or CIFilter to achieve same  effect? (I've tried but didn't get it. May be I'm missing something)</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Ok.. Thnks to @firstinq. I opened his <a href="https://stackoverflow.com/questions/45279684/ios-swift-sketch-style-gaussian-blur-effect-in-swift-3#comment77523164_45279684">link</a> and realised that I was using kCIInputRadiusKey instead of inputRadius. Now I'm succeed in simulator but in real iOS device, it's still messed.</p>
  
  <p>Here is the screenshot in simulator(iPhone SE):</p>
  
  <p><a href="https://i.stack.imgur.com/KI8Ej.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KI8Ej.png" alt="enter image description here"></a></p>
  
  <p>But in real iOS device(iPhone SE):</p>
  
  <p><a href="https://i.stack.imgur.com/lyQGp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lyQGp.png" alt="enter image description here"></a></p>
  
  <p>Here is my code for blurring image:</p>
  
  <pre><code>   func applyBlurEffect(image: UIImage) -&gt; UIImage{
      let imageToBlur = CIImage(image: image)
      let blurfilter = CIFilter(name: "CIGaussianBlur")
      blurfilter?.setValue(imageToBlur, forKey: "inputImage")
      blurfilter?.setValue(13.4, forKey: "inputRadius")
      let resultImage = blurfilter?.value(forKey: "outputImage") as! CIImage
      let blurredImage = UIImage(ciImage: resultImage)
      return blurredImage
  }
  </code></pre>
  
  <p>I'm using two images in collectionView item. One image is blurred, And above it, another is fully visible. Blurred image is 125x125 sized  (Gaussian blur will reduce this size). And 
  visible image is 50x50 sized. Both images has corner radius to make them circular.</p>