How To Take A Screenshot From A macOS App Using Swift

Grace Huang
4 min readOct 24, 2022
The RedacApp I built was trying to capture the Safari window.

If you are building an image processing app on macOS, taking a screenshot on the screen and load it into the app directly is a straightforward way to import the image.

In this article, I will show you how to do it in your Swift code.

(My latest book “macOS App Development: The SwiftUI Way” is now available. Grab your copy today!)

--

--

Grace Huang

I write about startups, entrepreneurship, investing, software, hardware and manufacturing.