     }
     
     func settings() {
-        
         translatesAutoresizingMaskIntoConstraints = false
         layer.masksToBounds = true
         backgroundColor = CL.cBackgroundColor

        
        let f = UIFont(name: CL.cFontName, size: CL.cFontSize)
        if let f = f {
            
            font = f
        } else {
            
            font = UIFont(name: font.fontName, size: CL.cFontSize)
        }
        textColor = CL.cTextColor

    open static var cBorderWidth: CGFloat = 0
    open static var cBorderColor = UIColor.clear
    open static var cPositionFromEdge: CGFloat = 10
    open static var cInitialPosition: InitialPosition = .top
    open static var cExtraShowTimeForMessage: Double = 0.5
    open static var cAnimationDuration: Double = 1
    
    open static let instance = PVShowMessage()
    fileprivate var animations: [(text: String, identifier: AnyObject?)] = []
    fileprivate var concurrentAnimations = 0
    
    open func showMessage(text: String) {
        showMessage(text: text, identifier: nil)
    }
    
    open func showMessage(text: String, identifier: AnyObject?) {
        let pinTo = UIApplication.shared.delegate!.window!!
        if animations.isEmpty {
            animations.append((text: text, identifier: identifier))
            if concurrentAnimations == 0 {
                _ = PVView(pinTo: pinTo, text: text, identifier: identifier)
            }
        } else {
            animations.append((text: text, identifier: identifier))
        }
    }
    
    open func removeAllMessages() {
        animations = []
    }
    
    fileprivate static func delay(seconds: Double, completion:@escaping ()->()) {
        let popTime = DispatchTime.now() + Double(Int64( Double(NSEC_PER_SEC) * seconds )) / Double(NSEC_PER_SEC)
        DispatchQueue.main.asyncAfter(deadline: popTime) {
            completion()
        }
    }
}

class PVView: UIView {
    var width: NSLayoutConstraint? = nil
    var height: NSLayoutConstraint? = nil
    var identifier: AnyObject? = nil
    
    func changeSignIfNeeded(_ number: CGFloat) -> CGFloat {
        return CL.cInitialPosition == .top ? -number : number
    }
    
    func handleTap(_ sender: UIGestureRecognizer) {
        if let delegate = CL.instance.delegate {
            delegate.didTapToMessage(identifier)
        }
    }
    
    convenience init (pinTo: AnyObject, text: String, identifier: AnyObject?) {
        self.init(frame:CGRect.zero)
        self.identifier = identifier
        let tap = UITapGestureRecognizer(target: self, action: #selector(PVView.handleTap(_:)))
        tap.numberOfTapsRequired = 1
        tap.numberOfTouchesRequired = 1
