 import UIKit
 
 public extension UIView {
+  
+    
     public func getConstraint(identifier: String) -> NSLayoutConstraint? {
         if let superview = self.superview {
             for constraint in superview.constraints where constraint.identifier == identifier {

        return getConstraints(item: self, attribute: attr)
    }

    public func getConstraints(item view: AnyObject, attribute attr: NSLayoutAttribute) -> [NSLayoutConstraint] {
        var results: [NSLayoutConstraint] = []

        if let superview = self.superview {
            results += UIView.targetFromConstraints(superview, item: view, attribute: attr)
        }
        results += UIView.targetFromConstraints(self, item: view, attribute: attr)
        
        return results
    }
    
    
    private class func targetFromConstraints(target: AnyObject, item view: AnyObject, attribute attr: NSLayoutAttribute) -> [NSLayoutConstraint] {
        var results: [NSLayoutConstraint] = []
        
        for constraint in target.constraints {

            } else {
                targetAttribute = constraint.firstAttribute
            }
         
            let firstItemEqual: Bool
            let secondItemEqual: Bool
            
            if view == nil {
                firstItemEqual =  constraint.secondItem === target
                secondItemEqual = constraint.firstItem === target
            } else {
                firstItemEqual = constraint.firstItem === view
                secondItemEqual = constraint.secondItem === view
            }
            
            guard targetAttribute == attr && (firstItemEqual || secondItemEqual) else {
                continue
            }
            
            results.append(constraint)
        }
        return results
