mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-25 06:18:37 +00:00
29 lines
633 B
Swift
29 lines
633 B
Swift
#if canImport(AppKit)
|
|
|
|
/// Normalizes the interface between NSPasteboard and UIPasteboard for working with pasteboard
|
|
/// strings.
|
|
extension OSPasteboard {
|
|
@MainActor static let find = OSPasteboard(name: .find)
|
|
|
|
/// The pasteboard's current string value.
|
|
@MainActor var string: String? {
|
|
get {
|
|
string(forType: .string)
|
|
}
|
|
set {
|
|
clearContents()
|
|
if let newValue {
|
|
setString(newValue, forType: .string)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#elseif canImport(UIKit)
|
|
|
|
extension OSPasteboard {
|
|
static let find = OSPasteboard.withUniqueName()
|
|
}
|
|
|
|
#endif
|