 
     private func reset() {
 
-        if !isOrientationChange {
+        if !isLayoutingSubviews {
             currentIndex = 0
         }
 


    public func scrollViewDidScroll(_ scrollView: UIScrollView) {

        if isJumping || isOrientationChange { return }

        // update currentIndex
        if scrollView.contentOffset.x >= frame.width * CGFloat(currentIndex + 1) {

        contentScrollView?.update(toIndex)
        currentIndex = toIndex

        if !isLayoutingSubviews {
            delegate?.swipeMenuView(self, didChangeIndexFrom: fromIndex, to: toIndex)
        }
    }
