title: Swift popup view not displaying from another popup view
body: <p>I am new on swift and I would like to show myFirst popup view, then when I clicked a button inside myFirst popup view, I would like to dismiss myFirst popup view and open mySecond popup view. But after myFirst popup view dissmissed, mySecond popup view not presenting..</p>
  
  <p>Here is what I tried so far;</p>
  
  <p>To open myFirst popup:</p>
  
  <pre><code>presentPopupView(myFirst!)
  </code></pre>
  
  <p>it is working fine, then when I clicked button in this popup view, I am doing this:</p>
  
  <pre><code>        self.dismissPopupView()
  
          self.presentPopupView(mySecond!)
  </code></pre>
  
  <p>In here, myFirst popup dissmiss correctly. But there is no mySecond popup view displaying..</p>
  
  <p>Any advise? Thanks</p>
  
  <p>Update: I am using STZPopupView <a href="https://github.com/STAR-ZERO/STZPopupView" rel="nofollow noreferrer">library</a></p>
  
  <p>Here is presentPopupView method:</p>
  
  <pre><code>public func presentPopupView(_ popupView: UIView, config: STZPopupViewConfig = STZPopupViewConfig()) {
  
      if self.containerView != nil {
          return
      }
  
      let containerView = UIView(frame: targetView.bounds)
      containerView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
      let overlayView = UIView(frame: targetView.bounds)
      overlayView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
      overlayView.backgroundColor = config.overlayColor
      containerView.addSubview(overlayView)
  
      // blur effect
      if let blurStyle = config.blurEffectStyle {
          let blurEffectView = UIVisualEffectView(effect: UIBlurEffect(style: blurStyle))
          blurEffectView.frame = containerView.frame;
          blurEffectView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
          containerView.addSubview(blurEffectView)
      }
  
      let dismissButton = UIButton(frame: targetView.bounds)
      dismissButton.autoresizingMask = [.flexibleHeight, .flexibleWidth]
      containerView.addSubview(dismissButton)
      if config.dismissTouchBackground {
          dismissButton.addTarget(self, action: #selector(dismissPopupView), for: UIControl.Event.touchUpInside)
      }
  
      popupView.center = CGPoint(x: targetView.bounds.midX, y: targetView.bounds.midY)
      popupView.autoresizingMask = [.flexibleLeftMargin,
                                    .flexibleTopMargin,
                                    .flexibleRightMargin,
                                    .flexibleBottomMargin]
      popupView.layer.cornerRadius = config.cornerRadius
      containerView.addSubview(popupView)
  
      targetView.addSubview(containerView)
  
      self.containerView = containerView
      self.popupView = popupView
      self.config = config
  
      showAnimation()
  }
  </code></pre>