 
 open class PhotoCaptureViewController: UIViewController, PhotoCollectionViewLayoutDelegate {
     open weak var delegate: PhotoCaptureViewControllerDelegate?
-    open var imagePickerAdapter: ImagePickerAdapter? = ImagePickerControllerAdapter()
+    open var imagePickerAdapter: ImagePickerAdapter? = ImagePickerControllerAdapter() {
+        didSet {
+            updateImagePickerButton()
+        }
+    }
 
     /// Optional view to display when returning from imagePicker not finished retrieving data.
     /// Use constraints to position elements dynamically, as the view will be rotated and sized with the device.

        closeButton.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
        containerView.addSubview(closeButton)

        if imagePickerAdapter != nil {
            let pickerButtonWidth: CGFloat = 114
            pickerButton = UIButton(frame: CGRect(x: view.bounds.width - pickerButtonWidth - buttonMargin, y: buttonMargin, width: pickerButtonWidth, height: 38))
            pickerButton.setTitle(NSLocalizedString("Photos", comment: "Select from Photos buttont itle"), for: UIControlState())
            pickerButton.setImage(UIImage(named: "PhotosIcon"), for: UIControlState())
            pickerButton.addTarget(self, action: #selector(presentImagePickerTapped(_:)), for: .touchUpInside)
            pickerButton.titleLabel?.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.footnote)
            pickerButton.autoresizingMask = [.flexibleTopMargin]
            pickerButton.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
            roundifyButton(pickerButton)
            view.addSubview(pickerButton)
        }

        previewView.alpha = 0.0
        captureManager.prepare { error in

            case .landscapeLeft, .landscapeRight, .portrait, .portraitUpsideDown:
                self.orientation = UIDevice.current.orientation
                self.updateWidgetsToOrientation()
            }
        }
    }

    private func updateImagePickerButton() {
        if imagePickerAdapter == nil {
            if pickerButton != nil {
                pickerButton?.removeFromSuperview()
                pickerButton = nil
            }
        } else {
            if pickerButton == nil {
                let pickerButtonWidth: CGFloat = 114
                pickerButton = UIButton(frame: CGRect(x: view.bounds.width - pickerButtonWidth - buttonMargin, y: buttonMargin, width: pickerButtonWidth, height: 38))
                pickerButton!.setTitle(NSLocalizedString("Photos", comment: "Select from Photos buttont itle"), for: UIControlState())
                pickerButton!.setImage(UIImage(named: "PhotosIcon"), for: UIControlState())
                pickerButton!.addTarget(self, action: #selector(presentImagePickerTapped(_:)), for: .touchUpInside)
                pickerButton!.titleLabel?.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.footnote)
                pickerButton!.autoresizingMask = [.flexibleTopMargin]
                pickerButton!.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
                roundifyButton(pickerButton!)
                view.addSubview(pickerButton!)
            }
        }
    }
