This is now available in a dedicated package: ActivityView
Alternatively my SwiftUI Backports now includes a more complete implementation of ShareLink
that's also more performant.
This is now available in a dedicated package: ActivityView
Alternatively my SwiftUI Backports now includes a more complete implementation of ShareLink
that's also more performant.
@chbeer @skywalkerlw @lahariganti @JetForMe
Just to let you know I'm now officially supporting this (and many other) SwiftUI views via a dedicated organisation, SwiftUI+.
If you can create any Issues on the new repo then I can respond and track them appropriately. I will respond much more quickly and can help you more effectively.
Also note, the API has some improvements and more improvements are on the way.
In terms of performance Activity controller's do take a second to start and even longer in DEBUG
builds, so if you run on device, then stop the debugger. Re-run the app from the icon on your device and re-test that way (as a user would) and I think you'll find the speed of the presentation is far better.
That being said, there are other things you may can do to improve, namely implementing the LinkPresentation
APIs if you can, since those load asynchronously (alongside the presentation itself). But please create Issues on the new repo to continue this conversation if needed, as I will no longer be checking them here.
Thanks.
Shaps
That's great, thanks!
👍
My new library, SwiftUI Backports now includes a more complete implementation of ShareLink
that's also more performant.
This will be available in the next release.
I'm finding I don't know the
activityItems
when the button is tapped. I have to make a network call to Firebase (ugh) to generate a link, and only then present the activity controller. At first I decided to make theactivityItems
an@autoclosure
, and then pass them in as@State
properties, but I don't want setting those to re-create my view. I’m not sure what the best thing to do here is. I don't really want to start generating the link until after the user taps the share button in the first place.