Reputation: 2569
Using SwiftUI's new ShareLink
, with a photo. The Share sheet does not have save to album option. Does anyone know how could I get that option, because I need to save an image to the photo library.
As you can see on the screenshot below, it only has add to shared album option.
struct Photo: Transferable {
static var transferRepresentation: some TransferRepresentation {
ProxyRepresentation(\.image)
}
public var image: Image
public var caption: String
}
ShareLink(item: photo, preview: SharePreview(photo.caption, image: Image("miniIcon"))) { }
Upvotes: 7
Views: 1178
Reputation: 2569
Solved. For whoever encountered this problem. You need to add photo library permission in the Info plist.
Upvotes: 24