         super.loadView()
         let size = self.view.bounds.size
         titleScrollView = UIScrollView(frame: CGRectZero)
+        titleScrollView.setTranslatesAutoresizingMaskIntoConstraints(false)
         titleScrollView.autoresizingMask = .FlexibleWidth | .FlexibleBottomMargin
         titleScrollView.backgroundColor = UIColor.whiteColor()
         titleScrollView.canCancelContentTouches = false
         titleScrollView.showsHorizontalScrollIndicator = false
         titleScrollView.bounces = false
         titleScrollView.delegate = self
-        titleScrollView.setTranslatesAutoresizingMaskIntoConstraints(false)
         self.view.addSubview(titleScrollView)
         
         bottomLine = UIView(frame: CGRectZero)

        let frame = CGRectMake(contentScrollView.frame.size.width * CGFloat(index), 0,
            contentScrollView.frame.size.width, contentScrollView.frame.size.height) ;
        if frame.origin.x < contentScrollView.contentSize.width {
            contentScrollView.scrollRectToVisible(frame, animated: animated)
        }
    }

            let next = Int(floor(page))
            if next != selectedIndex {
                selectedIndex = next
                UIView.animateWithDuration(0.3, animations:layoutTabIndicator)
            }
            
            var ignored : Double = 0.0
            page = scrollView.contentOffset.x / pageWidth;// Current page index with fractions
            let index = Int(page)
            if index + 1 < viewControllerCount && enableParallex {
                // We are using the difference from one label to the other to implement varying speeds
                // for our custom parallax effect, so every title is exactly centered if you are on a page
                let diff = tabLabels[index+1].frame.origin.x - tabLabels[index].frame.origin.x
                let centering1 = (titleScrollView.bounds.size.width - tabLabels[index].frame.size.width)/2
                let centering2 = (titleScrollView.bounds.size.width - tabLabels[index+1].frame.size.width)/2
                let frac = CGFloat(modf(Double(page), &ignored))// Only fraction part remains, Eg 3.4344 -> 0.4344
                let newXOff = tabLabels[index].frame.origin.x + diff * frac - centering1 * (1-frac) - centering2 * frac;
                titleScrollView.contentOffset = CGPointMake(fmax(0, newXOff), 0)
            }
        }
    }
    
    public func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
        enableParallex = true // Always enable after an animation
    }
}