         previewLayer.frame = CGRect(x: 0, y: 0, width: viewFinderWidth, height: viewFinderHeight)
         previewView.layer.addSublayer(previewLayer)
 
-        focusIndicatorView = UIView(frame: CGRect(x: 0, y: 0, width: 64, height: 64))
         focusIndicatorView.backgroundColor = UIColor.clear
         focusIndicatorView.layer.borderColor = UIColor.orange.cgColor
         focusIndicatorView.layer.borderWidth = 1.0
         focusIndicatorView.alpha = 0.0
         previewView.addSubview(focusIndicatorView)
 
-        flashButton = UIButton(frame: CGRect(x: viewFrame.origin.x + buttonMargin, y: viewFrame.origin.y + buttonMargin, width: 70, height: 38))
+        flashButton.frame = CGRect(x: viewFrame.origin.x + buttonMargin, y: viewFrame.origin.y + buttonMargin, width: 70, height: 38)
         flashButton.setImage(UIImage(named: "LightningIcon"), for: UIControlState())
         flashButton.setTitle(NSLocalizedString("Off", comment: "flash off"), for: UIControlState())
         flashButton.addTarget(self, action: #selector(flashButtonTapped(_:)), for: .touchUpInside)

            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: viewFrame.width - pickerButtonWidth - buttonMargin, y: viewFrame.origin.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!)
            }
        }
    }

                self.captureButton.isEnabled = true
                self.previewView.alpha = 1.0
            })
        }
    }

    private func updateImagePickerButton() {
        if imagePickerAdapter == nil {
            if pickerButton != nil {
                pickerButton?.removeFromSuperview()
                pickerButton = nil
            }
        } else {
            let pickerButtonWidth: CGFloat = 114

            if pickerButton == nil {
                pickerButton = UIButton(frame: CGRect(x: viewFrame.width - pickerButtonWidth - buttonMargin, y: viewFrame.origin.y + buttonMargin, width: pickerButtonWidth, height: 38))
                pickerButton!.setTitle(NSLocalizedString("Photos", comment: "Select from Photos button title"), 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!)
            } else {
                pickerButton?.frame = CGRect(x: viewFrame.width - pickerButtonWidth - buttonMargin, y: viewFrame.origin.y + buttonMargin, width: pickerButtonWidth, height: 38)
            }
        }
    }

