Triton/Packages/Utilities/Sources/ClipboardService/Services/MacOSClipboardService.swift
Otavio Cordeiro ee174ab836 Add SwiftLint
2026-01-14 12:30:53 -03:00

37 lines
763 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