         self.setCurrentIndex(self.indexSelected, animated: false)
     }
     
-    public override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
-    }
-    
     public override func viewWillLayoutSubviews() {
         super.viewWillLayoutSubviews()
         self.navigationBarView.frame = CGRectMake(0, 0, self.SCREENSIZE.width, 44)

        }
        self.indexSelected = index
        // Get the right position and update it
        var xOffset = CGFloat(index) * self.SCREENSIZE.width
        self.scrollView.setContentOffset(CGPointMake(xOffset, self.scrollView.contentOffset.y), animated: animated)
    }
    

    }
    
    private func sendNewIndex(scrollView: UIScrollView){
        let xOffset      = Float(scrollView.contentOffset.x)
        var currentIndex = (Int(roundf(xOffset)) % (self.navigationBarView.subviews.count * Int(self.SCREENSIZE.width))) / Int(self.SCREENSIZE.width)
        if self.needToShowPageControl && self.pageControl.currentPage != currentIndex {
            self.pageControl.currentPage = currentIndex
