                 closeButton.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 0.0),
                 closeButton.heightAnchor.constraint(equalToConstant: 52.0),
                 closeButton.widthAnchor.constraint(equalToConstant: 52.0),
+                ].forEach { $0.isActive = true }
+            
+        }
+    }
+    
+    func layoutShareButton() {
+        shareButton.translatesAutoresizingMaskIntoConstraints = false
+        if #available(iOS 11.0, *) {
+            [
+                shareButton.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 0.0),
+                shareButton.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 0.0),
+                shareButton.heightAnchor.constraint(equalToConstant: 52.0),
+                shareButton.widthAnchor.constraint(equalToConstant: 52.0),
+                ].forEach { $0.isActive = true }
+        } else {
+            [
+                shareButton.topAnchor.constraint(equalTo: view.topAnchor, constant: 0.0),
+                shareButton.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 0.0),
+                shareButton.heightAnchor.constraint(equalToConstant: 52.0),
+                shareButton.widthAnchor.constraint(equalToConstant: 52.0),
                 ].forEach { $0.isActive = true }
             
         }

            layoutCloseButton()
        }
        
        // Caption Background
        view.addSubview(captionBackgroundView)
        

    @objc func closeButtonDidTap(_ sender: UIButton) {
        delegate?.photoSliderControllerWillDismiss?(self)
        dissmissViewControllerAnimated(animated: true)
    }
    
    @objc func shareButtonDidTap(_ sender: UIButton) {
        guard let currentImage = imageViews[currentPage].imageView.image else { return }
        
        let imageToShare : [UIImage] = [ currentImage ]
        let activityViewController = UIActivityViewController(activityItems: imageToShare, applicationActivities: nil)
        activityViewController.popoverPresentationController?.sourceView = self.view // so that iPads won't crash

        present(activityViewController, animated: true, completion: nil)
    }
    
    override public func viewWillAppear(_ animated: Bool) {
