     }
     
     private var isStarted = false
-    private var prevScrollingIndex = -1
-    private var prevPageIndex = -1
+    private var prevScrollingIndex: Int?
+    private var prevPageIndex: Int?
     
     private var isWaitingForPageChangedCallback = false
     private var pageChangedCallback: (Void -> Void)?

                    }
                    
                    UIView.animateWithDuration(NSTimeInterval(0.5), animations: { () in
                        self.cachedPageTabs[i]!.alpha = alpha
                        return
                    })
                }
            }

    
    override public func layoutSubviews() {
        super.layoutSubviews()
        self.isStarted = false
        
        dispatch_async(dispatch_get_main_queue()) {
            // set custom attrs
