Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

642 B
Raw Blame
import ExpoModulesCore
import QuickLook

/// QLPreviewController holds its data source weakly, so the module keeps the current one alive.
final class MobileWebShellPdfPreview: NSObject, QLPreviewControllerDataSource {
  private let url: URL

  init(url: URL) {
    self.url = url
  }

  func numberOfPreviewItems(in controller: QLPreviewController) -> Int {
    1
  }

  func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
    url as NSURL
  }
}

final class PdfPresenterUnavailableException: Exception {
  override var reason: String {
    "No screen is available to present the PDF"
  }
}