         label.text = "Left CenterY"
         label.translatesAutoresizingMaskIntoConstraints = false
         label.backgroundColor = UIColor.yellowColor()
-        self.view.addSubview(label)
-        
-        //Config constraints
-        switch constaintType {
-        case 0:
+        label.tag = 105
+        self.view.addSubview(label)
+        
+        //Config constraints
+        switch constaintType {
+        case 2 where self.isIOS9 == true:
+            if #available(iOS 9.0, *) {
+                // Creating the same constraints using Layout Anchors: from iOS 9.0
+                let margins = view.layoutMarginsGuide
+                label.leadingAnchor.constraintEqualToAnchor(margins.leadingAnchor).active = true
+                
+                label.centerYAnchor.constraintEqualToAnchor(margins.centerYAnchor).active = true
+            }
+        default:
             // Creating constraints using NSLayoutConstraint: from iOS 6.0
             NSLayoutConstraint(item: label, attribute: .Leading, relatedBy: .Equal, toItem: self.view,
                                attribute: .LeadingMargin, multiplier: 1.0, constant: 0).active = true
             
             NSLayoutConstraint(item: label, attribute: .CenterY, relatedBy: .Equal, toItem: self.view,
                                attribute: .CenterY, multiplier: 1.0, constant: 20.0).active = true
-        case 2 where self.isIOS9 == true:
-            if #available(iOS 9.0, *) {
-                // Creating the same constraints using Layout Anchors: from iOS 9.0
-                let margins = view.layoutMarginsGuide
-                label.leadingAnchor.constraintEqualToAnchor(margins.leadingAnchor).active = true
-                
-                label.centerYAnchor.constraintEqualToAnchor(margins.centerYAnchor).active = true
-            }
-        default:
-            // Creating constraints using Visual Format Language: from iOS 6.0
-            let metrics = ["padding":20.0]
-            let views : [String : AnyObject] = ["label": label,"bottomLayoutGuide": bottomLayoutGuide]
-            var allConstraints = [NSLayoutConstraint]()
-            let constraint1 = NSLayoutConstraint.constraintsWithVisualFormat("H:|-padding-[label]",
-                                                                             options: [], metrics: metrics, views: views)
-            allConstraints += constraint1
-            let constraint2 = NSLayoutConstraint.constraintsWithVisualFormat("V:|-[label]-|",
-                                                                             options: .AlignAllCenterY, metrics: metrics, views: views)
-            allConstraints += constraint2
-            NSLayoutConstraint.activateConstraints(allConstraints)
         }
     }
     func createCenterXTopLabel() {

                                                                             options: [], metrics: metrics, views: views)
            allConstraints += constraint2
            NSLayoutConstraint.activateConstraints(allConstraints)
        }
    }
    func createLeftBottomLabel() {
        //Create label
        let label = UILabel()
        label.text = "Left Bottom"
        label.translatesAutoresizingMaskIntoConstraints = false
        label.backgroundColor = UIColor.yellowColor()
        self.view.addSubview(label)
        
        //Config constraints
        switch constaintType {
        case 0:
            // Creating constraints using NSLayoutConstraint: from iOS 6.0
            NSLayoutConstraint(item: label, attribute: .Leading, relatedBy: .Equal, toItem: self.view,
                               attribute: .LeadingMargin, multiplier: 1.0, constant: 0).active = true
            
            NSLayoutConstraint(item: self.bottomLayoutGuide, attribute: .Top, relatedBy: .Equal, toItem: label,
                               attribute: .Bottom, multiplier: 1.0, constant: 20.0).active = true
        case 2 where self.isIOS9 == true:
            if #available(iOS 9.0, *) {
                // Creating the same constraints using Layout Anchors: from iOS 9.0
                let margins = view.layoutMarginsGuide
                label.leadingAnchor.constraintEqualToAnchor(margins.leadingAnchor).active = true
                
                let bottomLayoutGuide = self.bottomLayoutGuide
                bottomLayoutGuide.topAnchor.constraintEqualToAnchor(label.bottomAnchor, constant: 20.0).active = true
            }
        default:
            // Creating constraints using Visual Format Language: from iOS 6.0
            let metrics = ["padding":20.0]
            let views : [String : AnyObject] = ["label": label,"bottomLayoutGuide": bottomLayoutGuide]

        label.text = "Right CenterY"
        label.translatesAutoresizingMaskIntoConstraints = false
        label.backgroundColor = UIColor.yellowColor()
        label.tag = 107
        self.view.addSubview(label)
        
        //Config constraints
        switch constaintType {
        case 2 where self.isIOS9 == true:
            if #available(iOS 9.0, *) {
                // Creating the same constraints using Layout Anchors: from iOS 9.0
                let margins = view.layoutMarginsGuide
                label.trailingAnchor.constraintEqualToAnchor(margins.trailingAnchor).active = true
                
                label.centerYAnchor.constraintEqualToAnchor(margins.centerYAnchor).active = true
            }
        default:
            // Creating constraints using NSLayoutConstraint: from iOS 6.0
            NSLayoutConstraint(item: label, attribute: .Trailing, relatedBy: .Equal, toItem: self.view,
                               attribute: .TrailingMargin, multiplier: 1.0, constant: 0).active = true
            
            NSLayoutConstraint(item: label, attribute: .CenterY, relatedBy: .Equal, toItem: self.view,
                               attribute: .CenterY, multiplier: 1.0, constant: 20.0).active = true
        }
    }
    func createCenterXBottomLabel() {
        //Create label
        let label = UILabel()
        label.text = "CenterX Bottom"
        label.textAlignment = .Center
        label.translatesAutoresizingMaskIntoConstraints = false
        label.backgroundColor = UIColor.yellowColor()
        label.tag = 108
        self.view.addSubview(label)
        
        //Config constraints
        switch constaintType {
        case 2 where self.isIOS9 == true:
            if #available(iOS 9.0, *) {
                // Creating the same constraints using Layout Anchors: from iOS 9.0
                let margins = view.layoutMarginsGuide
                label.centerXAnchor.constraintEqualToAnchor(margins.centerXAnchor).active = true
                
                let bottomLayoutGuide = self.bottomLayoutGuide
                bottomLayoutGuide.topAnchor.constraintEqualToAnchor(label.bottomAnchor,constant: 20).active = true
            }
        default:
            // Creating constraints using NSLayoutConstraint: from iOS 6.0
            NSLayoutConstraint(item: label, attribute: .CenterX, relatedBy: .Equal, toItem: self.view,
                               attribute: .CenterX, multiplier: 1.0, constant: 0).active = true
            
            NSLayoutConstraint(item: self.bottomLayoutGuide, attribute: .Top, relatedBy: .Equal, toItem: label,
                               attribute: .Bottom, multiplier: 1.0, constant: 20.0).active = true
        }
    }
    
    func createCenterLabel() {
        //Create label
        let label = UILabel()
        label.text = "Center"
        label.translatesAutoresizingMaskIntoConstraints = false
        label.backgroundColor = UIColor.yellowColor()
        label.tag = 109
        self.view.addSubview(label)
        
        //Config constraints
        switch constaintType {
        case 2 where self.isIOS9 == true:
            if #available(iOS 9.0, *) {
                // Creating the same constraints using Layout Anchors: from iOS 9.0
                let margins = view.layoutMarginsGuide
                label.centerXAnchor.constraintEqualToAnchor(margins.centerXAnchor).active = true
                
                label.centerYAnchor.constraintEqualToAnchor(margins.centerYAnchor).active = true
            }
        default:
            // Creating constraints using NSLayoutConstraint: from iOS 6.0
            NSLayoutConstraint(item: label, attribute: .CenterX, relatedBy: .Equal, toItem: self.view,
                               attribute: .CenterX, multiplier: 1.0, constant: 0).active = true
            
            NSLayoutConstraint(item: label, attribute: .CenterY, relatedBy: .Equal, toItem: self.view,
                               attribute: .CenterY, multiplier: 1.0, constant: 20.0).active = true
        }
    }
}
