LogseqIntents.swift 788 B

1234567891011121314151617181920212223242526
  1. import AppIntents
  2. import UIKit
  3. struct QuickAddIntent: AppIntent {
  4. static var title: LocalizedStringResource = "Quick Add"
  5. static var description = IntentDescription("Open Logseq Quick Add")
  6. func perform() async throws -> some IntentResult {
  7. if let url = URL(string: "logseq://go/quick-add") {
  8. await UIApplication.shared.open(url)
  9. }
  10. return .result()
  11. }
  12. }
  13. struct RecordAudioIntent: AppIntent {
  14. static var title: LocalizedStringResource = "Record Audio"
  15. static var description = IntentDescription("Open Logseq Record Audio")
  16. func perform() async throws -> some IntentResult {
  17. if let url = URL(string: "logseq://go/audio") {
  18. await UIApplication.shared.open(url)
  19. }
  20. return .result()
  21. }
  22. }