     }
     
     
-    fileprivate func displayInView(_ superview:UIView) {
-        
+    fileprivate func displayInView(_ superview:UIView, origin: UIView) {
+
         superview.addSubview(self)
-        
+
         self.layoutMargins = UIEdgeInsetsMake(8, 13, 8, 13)
         self.layer.cornerRadius = 4
-        
-        switch self.direction {
-        case .left:
-            self.layer.anchorPoint = CGPoint(x: 1, y: 0.5)
-            break
-        case .right:
-            self.layer.anchorPoint = CGPoint(x: 0, y: 0.5)
-            break
-        case .bottom:
-            self.layer.anchorPoint = CGPoint(x: 0.5, y: 0)
-            break
-        case .top:
-            self.layer.anchorPoint = CGPoint(x: 0.5, y: 1)
-            break
-        case .topLeft:
-            self.layer.anchorPoint = CGPoint(x: 0, y: 1)
-            break
-        case .topRight:
-            self.layer.anchorPoint = CGPoint(x: 1, y: 1)
-            break
-        case .bottomLeft:
-            self.layer.anchorPoint = CGPoint(x: 0, y: 0)
-            break
-        case .bottomRight:
-            self.layer.anchorPoint = CGPoint(x: 1, y: 0)
-            break
-        }
         
         triangleShapeLayer?.removeFromSuperlayer()
         

        self.setNeedsLayout()
        self.layoutIfNeeded()
        
        switch self.direction {
            
        case .bottom, .bottomLeft, .bottomRight:
            superview.addConstraint(NSLayoutConstraint(item: self, attribute: .top, relatedBy: .equal, toItem: superview, attribute: .bottom, multiplier: 1, constant:  triangleSpacing - (self.bounds.height / 2) ))
            break
            
        case .top, .topRight, .topLeft:
            superview.addConstraint(NSLayoutConstraint(item: self, attribute: .bottom, relatedBy: .equal, toItem: superview, attribute: .top, multiplier: 1, constant:  (triangleSpacing - (self.bounds.height / 2)) * -1))
            break
            
        case .left, .right:
            superview.addConstraint(NSLayoutConstraint(item: superview, attribute: .centerY, relatedBy: .equal, toItem: self, attribute: .centerY, multiplier: 1, constant:  0))
            break
        }
        
        switch self.direction {
        case .left:
            superview.addConstraint(NSLayoutConstraint(item: self, attribute: .right, relatedBy: .equal, toItem: superview, attribute: .left, multiplier: 1, constant: (triangleSpacing - (self.bounds.width / 2)) * -1))
            break
        case .bottomRight, .topRight:
            self.superview?.addConstraint(NSLayoutConstraint(item: superview, attribute: .right, relatedBy: .equal, toItem: self, attribute: .right, multiplier: 1, constant:  ((self.bounds.width / 2)) * -1))
            break
        case .bottomLeft, .topLeft:
            self.superview?.addConstraint(NSLayoutConstraint(item: superview, attribute: .left, relatedBy: .equal, toItem: self, attribute: .left, multiplier: 1, constant:  ((self.bounds.width / 2))))
            break
        case .right:
            superview.addConstraint(NSLayoutConstraint(item: self, attribute: .left, relatedBy: .equal, toItem: superview, attribute: .right, multiplier: 1, constant:  triangleSpacing - (self.bounds.width / 2) ))
            break
        case .top, .bottom:
            self.superview?.addConstraint(NSLayoutConstraint(item: superview, attribute: .centerX, relatedBy: .equal, toItem: self, attribute: .centerX, multiplier: 1, constant:  0))
            break
        }
        
        if (animationEnable) {
            


private var tooltipTapGestureKey: UInt8 = 0
private var tooltipViewKey: UInt8 = 0
private var tooltipDisplayViewKey: UInt8 = 1

public extension UIView {
    
