 }
 
 enum PhotoSliderControllerScrollMode:Int {
-    case None = 0, Vertical, Horizontal
+    case None = 0, Vertical, Horizontal, Rotating
 }
 
 public class ViewController:UIViewController, UIScrollViewDelegate {

        }
        
        self.generateCurrentPage()
  
    }
    
    func generateCurrentPage() {
        if self.visiblePageControl {
            if fmod(scrollView.contentOffset.x, scrollView.frame.size.width) == 0.0 {
                if self.pageControl != nil {
                    self.pageControl.currentPage = Int(scrollView.contentOffset.x / scrollView.frame.size.width)
                }
            }
        }
    }

    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 {

            scrollView.contentOffset = contentOffset
            
            let screenHeight = UIScreen.mainScreen().bounds.size.height
            
            if self.scrollView.contentOffset.y > screenHeight * 1.4 {
                self.closePhotoSlider(true)
            } else if self.scrollView.contentOffset.y < screenHeight * 0.6  {
