I\'m a beginner with Swift, and I\'m trying to figure out how can I read what has been copied to the clipboard On macOS (Swift 3)? I\'ve searched a lot but can\'t seem to find a
Times have changed. In Swift 3+ you would do it like this: (if you are only interested in strings)
func clipboardContent() -> String? { return NSPasteboard.general.pasteboardItems?.first?.string(forType: .string) }