title: How to Draw the Gaussian Blur Effect?
body: <p>I need to draw the blur effect on the UIView using Objective C.</p>
  
  <p>Here is my design</p>
  
  <p><a href="https://i.stack.imgur.com/wJR8P.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wJR8P.png" alt="enter image description here"></a></p>
  
  <pre><code>    UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle: UIBlurEffectStyleExtraLight];
  
      UIVisualEffectView *contentView = [[UIVisualEffectView alloc] initWithEffect: blurEffect];
  
      contentView.layer.cornerRadius = 18.0;
  
      contentView.layer.masksToBounds = YES;
  
      contentView.backgroundColor = [UIColor whiteColor];
  
      contentView.userInteractionEnabled = NO;
  
      contentView.layer.shadowRadius = 10;
  
      contentView.layer.shadowOpacity = 0.2f;
  
      contentView.layer.shadowColor = [UIColor whiteColor].CGColor;
  
      contentView.layer.shadowOffset =  CGSizeZero;
  
      [contentView setFrame: annotationFrame];
  
      [contentView setTranslatesAutoresizingMaskIntoConstraints: YES];
  
      self.contentView = contentView;
  </code></pre>
  
  <p>below screenshot was current output using the above code</p>
  
  <p><a href="https://i.stack.imgur.com/FdZgE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FdZgE.png" alt="enter image description here"></a></p>
  
  <p>I have tried the above code. , but I didn't get the exact blur effect 
  kindly suggest me to draw this design.</p>
  
  <p>I have updated the below code</p>
  
  <pre><code>- (void)drawRect:(CGRect)rect {
  
      [super drawRect: rect]; //i doubt we need a super drarRect here…
  
      [self drawMarker: self.markerView fillColor: [UIColor whiteColor]];
  
      CGContextRef ctx = UIGraphicsGetCurrentContext();
  
  
      CGPathRef path = CGPathCreateWithRoundedRect(CGRectInset(rect,  self.frame.size.width/4,  self.frame.size.height/4), self.frame.size.width/8, self.frame.size.height/8, nil);
  
      CGContextSetFillColorWithColor(ctx,[UIColor slateColor].CGColor);
  
      CGContextSetShadowWithColor(ctx, CGSizeZero, self.frame.size.height/4,  [UIColor slateColor].CGColor);
  
  
      for ( int i = 0; i&lt;=6; i++) {
          CGContextAddPath(ctx, path);
          CGContextFillPath(ctx);
      }
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/2AX27.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2AX27.png" alt="enter image description here"></a></p>
  
  <p>I need the blur effect behind my view , kindly advice the me regarding this.</p>
  
  <p>Thank you.</p>