Questions tagged [swiftui-sharelink]

12 questions
10
votes
2 answers

SwiftUI ShareLink set file name

I'm using the ShareLink to share an FileDocument which contains a String. The FileDocument is conform to the Transferable protocol. This is the FileDocument Struct: struct TransferableDocument: FileDocument, Transferable { static var…
Patrick
  • 273
  • 2
  • 6
5
votes
1 answer

Programmatically open ShareLink in SwiftUI

Using ShareLink shows a Share button so it opens Share popup when user taps on that button. ShareLink(item: data, subject: Text("Subject"), message: Text("Message")) I would like to programmatically screenshot and then share on share popup. Is…
HarshIT
  • 4,583
  • 2
  • 30
  • 60
4
votes
0 answers

SwiftUI 4 ShareLink SharePreview unexpected behavior

When integrating the new ShareLink into my project, I noticed two unexpected things. First, when I pass a SharePreview to my sharelink with just a title and no image as a pararameter, my AppIcon suddenly loads in the preview. Is that normal? Just…
SwiftUI_Max
  • 201
  • 2
  • 6
2
votes
1 answer

How to use ShareLink with an item from an async function?

I want to use ShareLink to share a URL that is generated from an API call from an async function. I tried something like this, and it doesn't work: ShareLink (item: Task {await getSharingURL()} ) { Image(systemName: "square.and.arrow.up") } In…
Ori C.
  • 61
  • 7
1
vote
1 answer

Share multiple items (PDF's) with ShareLink and Transferable in SwiftUI

I want to share multiple PDF Documents with apples new ShareLink. I can share a single PDF Document by making my object transferable using the FileReprestation and giving my object into shareLink: extension item: Transferable { public static…
printDavid
  • 165
  • 1
  • 9
1
vote
0 answers

SwiftUI ShareLink: Changing the translatesAutoresizingMaskIntoConstraints property

I am getting following warning in the console when presenting SwiftUI's ShareLink: [LayoutConstraints] Changing the translatesAutoresizingMaskIntoConstraints property of a UICollectionReusableView that is managed by a UICollectionView is not…
Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93
0
votes
0 answers

How to make a ShareLink send an uneditable message - SwiftUI

I have a ShareLink that I want users to be able to share uneditable messages to others. This is in case the ShareLink is sending important data that could be misleading if it were to be edited by the sender (settings, high scores, etc.). Obviously…
0
votes
0 answers

Unexpected behavior when displaying `ShareLink`

When displaying SwiftUI's ShareLink in a Hebrew app, all words in the sheet are flipped horizontally. ShareLink(item: url) { Image(systemName: "square.and.arrow.up") .resizable() .aspectRatio(contentMode: .fit) .frame(width: 18,…
Pierre Janineh
  • 394
  • 2
  • 13
0
votes
0 answers

Using ShareLink in SwiftUI to create item text with URL link formatted for both the Message app and email

My need is to use ShareLink to allow the user to send formatted email or text message including a URL link. My SwiftUI code looks like: ShareLink( item: itemText, subject: Text("Message from app user"), preview:…
Chris Prince
  • 7,288
  • 2
  • 48
  • 66
0
votes
0 answers

iOS16 ShareLink URLScheme Rich Link Preview SwiftUI

I would like to have a button in the app that popups a ShareSheet with a link that routes to my app, via the ShareLink API. From this Apple documentation, iOS and macOS will automatically generate inline previews for links people send. However, if…
0
votes
0 answers

SwiftUI: How to share multiple items with ShareLink

I want to share images and text using ShareLink. This is the code for sharing only one image. ShareLink(item: image, preview: SharePreview(vm.post.text, image: image)) { Image(systemName: "square.and.arrow.up") .font(.system(size: 20)) …
0
votes
1 answer

ShareLink with custom type is not working

I want to share audio files with the new ShareLink in SwiftUI. I've a Recording entity from Core Data, witch store the URL from the audio file and the file itself is store in the FileManger. I already make Recording to conform Transferable…
LucasC
  • 43
  • 5