     optional func photoSliderControllerWillDismiss(viewController: PhotoSlider.ViewController)
     optional func photoSliderControllerDidDismiss(viewController: PhotoSlider.ViewController)
 }
+
+enum PhotoSliderControllerScrollMode:Int {
+    case None = 0, Vertical, Horizontal
+}
+
 
 
 public class ViewController:UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {


    public func scrollViewDidScroll(scrollView: UIScrollView) {

        let screenHeight = UIScreen.mainScreen().bounds.size.height
        let screenWidth = UIScreen.mainScreen().bounds.size.width


        if scrollView.contentOffset.y > 100 {

            self.collectionView.frame = scrollView.frame
            
            if self.delegate!.respondsToSelector("photoSliderControllerWillDismiss:") {
                self.delegate!.photoSliderControllerWillDismiss!(self)
            }
            
            UIView.animateWithDuration(
                0.5,
                delay: 0,
                options: UIViewAnimationOptions.CurveEaseOut,
                animations: { () -> Void in

                    self.view.alpha = 0.0
                },
                completion: {(result) -> Void in
                    self.dissmissViewControllerAnimated(false)
                }
            )

            
        } else if velocity.y > 500 {
            self.collectionView.frame = scrollView.frame;

            if self.delegate!.respondsToSelector("photoSliderControllerWillDismiss:") {
                self.delegate!.photoSliderControllerWillDismiss!(self)
            }

            UIView.animateWithDuration(
                0.4,
                delay: 0,
                options: UIViewAnimationOptions.CurveEaseOut,
                animations: { () -> Void in
