Triton/Packages/Utilities/Sources/ClipboardService/Services/MacOSClipboardService.swift
Otávio 3e878667a1 Add Triton App
Signed-off-by: Otavio Cordeiro <otaviocc@users.noreply.github.com>
2025-12-15 20:39:07 +01:00

34 lines
729 B
Swift

#if os(macOS)
import AppKit
struct MacOSClipboardService: ClipboardServiceProtocol {
func copy(_ string: String) {
NSPasteboard
.general
.clearContents()
NSPasteboard
.general
.setString(
string,
forType: .string
)
}
func copy(_ data: Data, type: String) {
NSPasteboard
.general
.clearContents()
NSPasteboard
.general
.setData(
data,
forType: NSPasteboard.PasteboardType(type)
)
}
}
#endif