INNER CODE UNIT · Swift

imagePickerControllerDidCancel

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

  public func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
    picker.dismiss(animated: true) { [weak self] in
      self?.finish(value: nil)
    }
  }

  public func imagePickerController(_ picker: UIImagePickerController,
                                    didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {
    let image = (info[.originalImage] as? UIImage)
    picker.dismiss(animated: true) { [weak self] in
      self?.finish(value: image.flatMap { Self.decode(image: $0) })
    }
  }
}

final class ScanViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate {
  private let onResult: (String?, String?) -> Void
  private let accent: UIColor

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…