f197b68573
Long-press mic runs ASR as an instruction over eligible clipboard text, with host-confirm recording UI, min-record gate, and light ASR prewarm. Bump CURRENT_PROJECT_VERSION to 53.
18 lines
542 B
Swift
18 lines
542 B
Swift
// ClipboardPasteboardReader.swift
|
|
// OSGKeyboard · Keyboard Extension
|
|
//
|
|
// Opportunity-read of UIPasteboard for clipboard-command eligibility.
|
|
|
|
import UIKit
|
|
import OSGKeyboardShared
|
|
|
|
enum ClipboardPasteboardReader {
|
|
static func sample() -> (changeCount: Int, text: String?) {
|
|
let board = UIPasteboard.general
|
|
let changeCount = board.changeCount
|
|
// Prefer plain strings; avoid forcing non-text pasteboard items.
|
|
let text = board.hasStrings ? board.string : nil
|
|
return (changeCount, text)
|
|
}
|
|
}
|