简体   繁体   中英

How to write into Photo Library on Mac?

Is it possible to write directly into the Photo Library for example an image on MacOs using Swift?

The only thing I have found is the Photo Kit where is a class named PHAssetCreationRequest which provides methods for writing into the photo library. But it is in Beta state.

Are some stable versions out there to write directly into the Photo Library?

Thank you for your help.

As you've found, PHAssetCreationRequest is the only API for writing photos to the macOS photo library, and it's only available on macOS 10.15 and later. There's also a MediaLibrary API for read-only access.

Typically, macOS apps don't save photos directly to the photo library. Instead they should allow users to save files to wherever they want, and the user can either:

For example, if the user wants to import into their photos library, they should be able to drag multiple images from your app and drop them on the Photos icon in the dock to import them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM