Swiftpack.co -  Clipy/Screeen as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Observe user screen shot event in macOS.
.package(url: "https://github.com/Clipy/Screeen.git", from: "v2.0.1")


Actions Status Release version License: MIT Carthage compatible Version Platform SPM supported

Observe user screen shot event and image in macOS.



pod 'Screeen'


github "Clipy/Screeen"


let observer = ScreenShotObserver()
observer.delegate = self
func screenShotObserver(_ observer: ScreenShotObserver, addedItem item: NSMetadataItem) {
    print("added item == \(item)")

func screenShotObserver(_ observer: ScreenShotObserver, updatedItem item: NSMetadataItem) {
    print("updated item == \(item)")

func screenShotObserver(_ observer: ScreenShotObserver, removedItem item: NSMetadataItem) {
    print("removed item == \(item)")

Change observing status

observer.isEnabled = false // Stop observing
observer.isEnabled = true  // Restart observing

Security features of macOS 10.15 or higher

Security features have been enhanced since mac10.15 Catalina, and screenshot monitoring must be granted permission. The monitoring target can be specified for each directory, and the desktop directory is specified by default. 

When call start() for the first time, a permission alert will be displayed and monitoring will start when allow it.

Desktop directory monitoring (default)

let observer = ScreenShotObserver()

Desktop and Picture directories monitoring

let desktopPath = NSSearchPathForDirectoriesInDomains(.desktopDirectory, .userDomainMask, true).first
let picturePath = NSSearchPathForDirectoriesInDomains(.picturesDirectory, .userDomainMask, true).first
let directoryPaths = [desktopPath, picturePath].compactMap { $0 }
let observer = ScreenShotObserver(searchDirectoryPaths: directoryPaths)

Monitoring all screenshots on macOS 10.14 or earlier

let observer: ScreenShotObserver
if #available(macOS 10.15, *) {
    observer = ScreenShotObserver()
} else {
    observer = ScreenShotObserver(searchDirectoryPaths: [])

Sandbox support

In order to monitor screen shots in a Sandbox enabled application, the user must manually select the directory to be monitored.
See here for more details on how to implement it.


Stars: 30
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Related Packages

Release Notes

1 year ago


  • Added @objc annotation to ScreenShotObserverDelegate ( #18 )


  • None.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API