             return
         }
         
+        if self.scrollMode == .Rotating {
+            return
+        }
+        
         let offsetX = fabs(scrollView.contentOffset.x - self.scrollPreviewPoint.x)
         let offsetY = fabs(scrollView.contentOffset.y - self.scrollPreviewPoint.y)
-
+        
         if self.scrollMode == .None {
             if (offsetY > offsetX) {
                 self.scrollMode = .Vertical;

            }
        )
    }

    public func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
        self.scrollMode = .None
    }

    // MARK: - Button Actions

    func closeButtonDidTap(sender:UIButton) {
        if self.delegate!.respondsToSelector("photoSliderControllerWillDismiss:") {
            self.delegate!.photoSliderControllerWillDismiss!(self)
        }
        self.dissmissViewControllerAnimated(true)
    }
    
    // MARK: - Private Methods

        }
        
        self.generateCurrentPage()
    }
    
    func generateCurrentPage() {
        self.currentPage = abs(Int(scrollView.contentOffset.x / scrollView.frame.size.width))
        
        if fmod(scrollView.contentOffset.x, scrollView.frame.size.width) == 0.0 {
            if self.visiblePageControl {
                if self.pageControl != nil {
                    self.pageControl.currentPage = self.currentPage
                }
            }
        }
    }
    
    public func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) {
        
        if self.scrollMode == .Vertical {
            
            let velocity = scrollView.panGestureRecognizer.velocityInView(scrollView)
            if velocity.y < -500 {
                self.scrollView.frame = scrollView.frame;
                self.closePhotoSlider(true)
            } else if velocity.y > 500 {
