INNER CODE UNIT · Swift

presentPicker

wu9007/qrcode_scanner · ios/Classes/SwiftQrscanPlugin.swift:90

  private func presentPicker() {
    let picker = UIImagePickerController()
    picker.sourceType = .photoLibrary
    picker.delegate = self
    present(picker)
  }

  private func present(_ controller: UIViewController) {
    guard let root = Self.topViewController() else {
      finish(errorCode: "NO_ACTIVITY", message: "Unable to present scanner")
      return
    }
    controller.modalPresentationStyle = .fullScreen
    root.present(controller, animated: true)
  }

  private func finish(value: String?) {
    pendingResult?(value)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…