title: Not able to show border color and background as blur in custom view as popup view in Swift
body: <p>I have some requirement to show popup as some customisation options.</p>
  
  <p>So, I took custom view as UIView with Xib file.</p>
  
  <pre><code>class CustomAlertView : UIView {
  @IBOutlet weak var customAlertView : UIView!
  @IBOutlet weak var button1 : UIButton!
  @IBOutlet weak var button2 : UIButton!
  
  override init(frame: CGRect) { // for using CustomView in code
      super.init(frame: frame)
      self.commonInit()
  }
  
  required init?(coder aDecoder: NSCoder) { // for using CustomView in IB
      super.init(coder: aDecoder)
      self.commonInit()
  }
  
  private func commonInit() {
      Bundle.main.loadNibNamed("CustomAlertView", owner: self)
      guard let content = customAlertView else { return }
      content.frame = self.bounds
      content.autoresizingMask = [.flexibleHeight, .flexibleWidth]
      self.addSubview(content)
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And given outlet connections.</p>
  
  <p>And I am able to load the view in viewcontroller class.</p>
  
  <p>But, the issue is, its not showing as pop up view and its not showing any border color, etc even I added too.</p>
  
  <p>And the present self.view (Main view from viewcontroller) still moving it has tableview, while I clicking on the buttons on custom view, nothing happening.</p>
  
  <pre><code>   func someAction() {
          self.view.addSubview(customAlert)
          self.customAlert.layer.cornerRadius = 13
          self.customAlert.layer.borderWidth = 10
          self.customAlert.layer.borderColor = UIColor.gray.cgColor
          self.customAlert.clipsToBounds = false
          let radius: CGFloat = self.customAlert.frame.width / 2.0 //change it to .height if you need spread for height
  
          let shadowPath = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 2.1 * radius, height: self.customAlert.frame.height))
  
          self.customAlert.layer.masksToBounds = false
          self.customAlert.layer.cornerRadius = 8; // if you like rounded corners
          self.customAlert.layer.shadowOffset = CGSize(width:-15, height:20);
          self.customAlert.layer.shadowRadius = 5;
          self.customAlert.layer.shadowOpacity = 0.5;
          self.customAlert.layer.shadowPath = shadowPath.cgPath
  
          self.customAlert.byMonthlyBtn.addTarget(self, action: #selector(button1tapped), for: .touchUpInside)
          self.customAlert.byAnnuallyBtn.addTarget(self, action: #selector(button2tapped), for: .touchUpInside)
  }
  </code></pre>
  
  <p>And its looks like below screenshot</p>
  
  <p><a href="https://i.stack.imgur.com/q1qJL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q1qJL.png" alt="enter image description here"></a></p>
  
  <p>Any suggestions?</p>