In my Notification Service Extension I am downloading an image from a URL to show as UNNotificationAttachment in a notification.
So I have this image as UIImage and don't see the need to write it in my app directory / group container on disc just to set up the notification.
Is there a good way create an UNNotificationAttachment with a UIImage ?
(should be appliable to local and remote notifications)

NSDatarepresentation of theUIImageinto the newly created directoryI wrote an extension on
UINotificationAttachmentSo to create
UNUserNotificationRequestwithUNUserNotificationAttachmentfrom aUIImageyou can simply do sth like thisThis should work since
UNNotificationAttachmentwill copy the image file to an own location.