30 questions
0
votes
1
answer
62
views
Call ShareUI programmatically [duplicate]
For my app, I have a list of transactions that can be exported as CSV or PDF.
For the CSV I use this ShareLink
ShareLink(item: exportData()){
Label("Export CSV", systemImage: "list....
0
votes
1
answer
153
views
How can I detect a ShareLink tap in SwiftUI?
The code is pretty basic, but using a .onTapGesture() doesn't appear to be the way to go.
The idea is to track the ShareLink interaction for analytics purposes.
ShareLink(item: URL(string: "...
0
votes
0
answers
40
views
Is there documentation on requirements for ShareLinking movies to social sites?
I have a SwiftUI app that allows the user to record a movie and passes that to a ShareLink:
struct MovieTransferable: Transferable {
let url: URL
let writeMovie: (URL) -> ()
...
1
vote
1
answer
309
views
ShareLink with multiple items only shares one at a time
I have a String and an URL containing audio and want to share both via a Sharelink.
I have written a Transferable:
struct TransferableTextAndAudio: Codable, Transferable {
let text: String
let ...
1
vote
0
answers
43
views
Sharing audio file with ShareLink sends the file but other apps (except VLC player) can't detect it right
Here's how I am using ShareLink:
struct ShareableAudioFile: Transferable {
let audioUrl: URL
@available(iOS 16.0, *)
static var transferRepresentation: some TransferRepresentation {
...
0
votes
0
answers
67
views
Simplest implementation log share button in SwiftUI?
I want to implement a log exporter to export user logs from pages like Settings or Mail. In UIKit, UIActivityViewController would work well, but I’m looking for a more modern approach using SwiftUI.
I ...
0
votes
2
answers
550
views
Why does the ShareLink not open a share sheet? (iOS 17.4)
I have a problem: I'm trying to open a share sheet from an alert, but the share sheet just does not open.
import SwiftUI
struct DocumentView: View {
// ...
@State private var newShare: ...
4
votes
3
answers
2k
views
How to trigger another action when tapping a ShareLink
Currently using SwiftUI built in ShareLink functionality.
I need to trigger a different action at the same time that ShareLink is pressed.
This ShareLink is nested within a SwiftUI Menu.
How would I ...
3
votes
0
answers
324
views
Using a ShareLink with a custom exported type identifier does not display any sharing options
I'm working with a custom exported type in my macOS app when I found that SwiftUI's ShareLink would not display any options for sharing.
Currently, I have a type that conforms to public.data and ...
0
votes
1
answer
145
views
How can I export a specific portion of a SwiftUI view and retain all styling and layout using ShareLink?
The goal is to utilize SwiftUI ShareLink to render, and share a specific portion of a SwiftUI View to Messages, Instagram, and other social media applications. My question is, what is the appropriate ...
1
vote
1
answer
557
views
Sharing an audio using ShareLink
Does anyone know how we can share a track(I have the URL, but I will download it, so consider I have the Data the I got from URL session) using ShareLink in Swift, that also has an image attached to ...
5
votes
0
answers
418
views
SwiftUI ShareLink with custom actions
Currently, I’m using a ShareLink to display the standard share sheet in my app. Now, I’d like to display actions inside the share sheet that perform a custom action like the following example.
With ...
0
votes
1
answer
106
views
Cannot generate image which is then shared
I'm coding in swiftUI, and I'm trying to create a button that first generates a new image and then opens a ShareSheet where the new image can be shared. However, with the code below, only the ...
0
votes
1
answer
381
views
Can't share a png. or jpeg. file to messages app with sharelink
If I run this code in swiftUI in Xcode:
ShareLink(item: "Hi", preview: SharePreview("Hi"))
I get two apps in the simulator: Messages and Reminders.
However, if I run this code to ...
2
votes
0
answers
703
views
SwiftUI: Adding a Share Button to Navigation title menu using ShareLink and the toolbarTitleMenu modifier
If you select a file in the Files app on iOS you can tap on the title and get some extra actions, similar to a context menu. I want this in one of my apps and learned about the toolbarTitleMenu ...
2
votes
1
answer
690
views
Conditional FileRepresentation format in transferRepresentation with Swift
I'm pretty new to Swift and iOS development, and have hit a stumbling block that I should have seen coming...
I've implemented a class called Media, which can contain Data or a Url, depending on the ...
1
vote
0
answers
62
views
How can I share a transparent PNG to iMessage from the Share Sheet?
When I try to share a transparent PNG via the Share Sheet and choose "AirDrop" or "Save Image" the saved image is transparent, however when I choose iMessage the image suddenly ...
0
votes
1
answer
378
views
How can I get "Save Image" as an option in the Share Sheet?
I'm trying to present a share sheet with an image. I'd expect the "Save Image" option to be there but it's not. Is there some trick to getting this working?
1
vote
1
answer
788
views
How to handle ShareLink in SwiftUI - I get memory leaks when I update an image?
I'll try to explain this as simple as possible. I've made an app that modifies an UIImage based on user actions.
To be able to share/save the resulting image, I added a ShareLink to my view.
Every ...
8
votes
1
answer
398
views
ShareLink in SwiftUI doesn't offer Copy link
Using any form of ShareLink with an URL or a String having an URL as text, never is the option Copy-Link offered, even when enabled and showed in the settings
ShareLink(item: url)
3
votes
1
answer
1k
views
SwiftUI ShareLink on optional URL
I want to use ShareLink to save a zipped backup file that needs to be generated in my code. I was able to do this in a clunky way and am looking for something more elegant.
My first way had a button ...
8
votes
2
answers
2k
views
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()} )
{...
2
votes
0
answers
1k
views
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(&...
2
votes
1
answer
602
views
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: "...
11
votes
1
answer
4k
views
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 ...
1
vote
1
answer
1k
views
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:
...
2
votes
0
answers
217
views
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 ...
15
votes
4
answers
4k
views
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: ...
0
votes
1
answer
2k
views
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 ...
5
votes
0
answers
609
views
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 ...