INNER CODE UNIT · Swift

present

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

  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)
    pendingResult = nil
  }

  private func finish(errorCode: String, message: String) {
    pendingResult?(FlutterError(code: errorCode, message: message, details: nil))
    pendingResult = nil
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…