     }
     
     public func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? {
-        return scrollView.subviews[0] as
-        UIView
-        
+        return scrollView.subviews[0] as UIView
     }
     
     
     // MARK: - Tap gestures Functions
     
     func handleTapGesture(sender: UITapGestureRecognizer!){
+        delegate?.galleryDidReceiveTap(self)
         removeGallery()
     }
     
     func handleDoubleTapGesture(sender: UITapGestureRecognizer){
+        delegate?.galleryDidReceiveDoubleTap(self)
         if scrollViewActive == false {
             scrollViewActive = true;
         }else {

    }
    
    func createMainView(){
        //Configure main view
        mainView = UIView(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height))
        mainView.layer.borderColor = UIColor.redColor().CGColor
        mainView.layer.borderWidth = 0

        if(images.count==0){
            return;
        }
        UIDevice.currentDevice().beginGeneratingDeviceOrientationNotifications()
        NSNotificationCenter.defaultCenter().addObserver(self, selector: "orientationChanged", name: UIDeviceOrientationDidChangeNotification, object: UIDevice.currentDevice())
        for v  in  self.view.subviews {
