     private func applyConstraints(fromView: UIView, toView: UIView, bottomMargin: CGFloat) {
         fromView.setTranslatesAutoresizingMaskIntoConstraints(false)
         
-        let heightConst = NSLayoutConstraint(item: fromView, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .Height, multiplier: 1.0, constant: fromView.bounds.height)
-        fromView.addConstraint(heightConst)
+        self.heightConstraint = NSLayoutConstraint(item: fromView, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .Height, multiplier: 1.0, constant: fromView.bounds.height)
+        fromView.addConstraint(self.heightConstraint!)
         
         let centerConst = NSLayoutConstraint(item: fromView, attribute: .CenterX, relatedBy: .Equal, toItem: self, attribute: .CenterX, multiplier: 1.0, constant: 0)
         let leftConst = NSLayoutConstraint(item: fromView, attribute: .Leading, relatedBy: .Equal, toItem: self, attribute: .Left, multiplier: 1.0, constant: 15.0)

class KenBurnsSlideshowTitleView: UIView {
    private var titleLabel: UILabel! = UILabel()
    private var subTitleLabel: UILabel! = UILabel()
    
    var title: String? {
        didSet {
            self.titleLabel.text = title
        }
    }
    var subTitle: String? {
        didSet {
            self.subTitleLabel.text = subTitle
        }
    }
    

        self.configure()
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.gradientLayer.bounds.size = CGSizeMake(self.bounds.width, 110.0)
        self.gradientLayer.frame.origin = CGPointMake(0, self.bounds.height - self.gradientLayer.bounds.height)
    }
    
    private func configure() {
        self.backgroundColor = UIColor.clearColor()
        
        self.titleLabel.frame.size.height = 20.0
        self.titleLabel.textColor = UIColor.whiteColor()
        self.insertSubview(self.titleLabel, atIndex: 0)
        
        self.subTitleLabel.frame.size.height = 20.0
        self.subTitleLabel.textColor = UIColor.whiteColor()
        self.insertSubview(self.subTitleLabel, atIndex: 0)
        
        self.gradientLayer.colors = [UIColor.clearColor().CGColor, UIColor.blackColor().colorWithAlphaComponent(0.6).CGColor]
        self.gradientLayer.locations = [0, 1.0]
        self.layer.insertSublayer(self.gradientLayer, atIndex: 0)
        
        self.applyConstraints(self.titleLabel, toView: self, bottomMargin: 20.0)
        self.applyConstraints(self.subTitleLabel, toView: self.titleLabel, bottomMargin: self.titleLabel.bounds.height)
