         }) { (Bool) -> Void in
             self.removeFromSuperview()
         }
-        
     }
-
-
 }

            self.backgroundView.alpha = 0
        }
        
        self.contentView = view
        
        self.contentView.center = CGPoint(x: (keyWindowBounds?.midX)!, y: (keyWindowBounds?.midY)!)
        
        self.addSubview(backgroundView)
        
        self.addSubview(contentView)
        
        
        if dismissOnBackgroundTap {
            
            let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(NMCustomView.dismiss))
            
            self.backgroundView.addGestureRecognizer(tapRecognizer)
        }
        

            
        }
        
        if let center: CGPoint = keyWindow?.center {
            self.contentView.center = center
        }
    }
    
    func dismiss() {
