         var activityItems: [AnyObject] = [underlyingImage]
         if photo.caption != nil && includeCaption {
             if let shareExtraCaption = SKPhotoBrowserOptions.shareExtraCaption {
-                let caption = photo.caption + shareExtraCaption
-                activityItems.append(caption as AnyObject)
+                activityItems.append(photo.caption + shareExtraCaption)
             } else {
-                activityItems.append(photo.caption as AnyObject)
-            }
-        }
-        
-        if let activityItemProvider = activityItemProvider {
-            activityItems.append(activityItemProvider)
-        }
-        
+                activityItems.append(photo.caption)
+            }
+        }
         activityViewController = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)
         activityViewController.completionWithItemsHandler = {
             (activity, success, items, error) in
             self.hideControlsAfterDelay()
             self.activityViewController = nil
         }
-        if UI_USER_INTERFACE_IDIOM() == .phone {
-            present(activityViewController, animated: true, completion: nil)
+        if UI_USER_INTERFACE_IDIOM() == .Phone {
+            presentViewController(activityViewController, animated: true, completion: nil)
         } else {
-            activityViewController.modalPresentationStyle = .popover
+            activityViewController.modalPresentationStyle = .Popover
             let popover: UIPopoverPresentationController! = activityViewController.popoverPresentationController
             popover.barButtonItem = toolbar.toolActionButton
-            present(activityViewController, animated: true, completion: nil)
-        }
-    }
-    
-    func getCurrentPageIndex() -> Int {
-        return currentPageIndex
+            presentViewController(activityViewController, animated: true, completion: nil)
+        }
     }
 }
 

        if photos.count > 1 {
            pagingScrollView.deleteImage()
            
            photos.remove(at: currentPageIndex)
            if currentPageIndex != 0 {
                gotoPreviousPage()
            }

// MARK: - Internal Function For Button Pressed, UIGesture Control

internal extension SKPhotoBrowser {
    func panGestureRecognized(sender: UIPanGestureRecognizer) {
        guard let zoomingScrollView: SKZoomingScrollView = pagingScrollView.pageDisplayedAtIndex(currentPageIndex) else {
            return
        }
        
        backgroundView.hidden = true
        
        let viewHeight: CGFloat = zoomingScrollView.frame.size.height
        let viewHalfHeight: CGFloat = viewHeight/2
        var translatedPoint: CGPoint = sender.translationInView(self.view)
        
        // gesture began
        if sender.state == .Began {
            firstX = zoomingScrollView.center.x
            firstY = zoomingScrollView.center.y
            
