|
This view for the results of a regatta can be shared using ShareLink. It is based on Paul's code for iOS16. The View takes 15sec to appear, and when I set breakpoints, I discovered that the two rendering methods (render() and ResultsAsText() ) are executing 3 times each before the View appears and before the .onAppear is triggerred, and then continuing to execute several times after the view appears. Is this normal? How can I remove the delays it is causing? Thanks
|
|
I've had issues lately when I'm using the ShareLink to share a PDF I generate too. Although I've not noticed it doing this repeat calling you have, but my PDFs are single-page and light, so perhaps I've just not noticed the delays as it's so fast :/ I'd much rather they had made ShareLink a type of standard button with an actions closure. As you've noted: the PDF needing to exist made this all more annoying than it feels it needs to be. As it stands, a computed property/ func are the options I went with too. Presumably it's not something simple like your |
|
Thanks for the input. It doesn't seem to be related to processScores, or the .onAppear in general, as the breakpoints in render trigger several times before it even gets to the .onAppear. This code actually stopped working in 17.4 until I found a suggestion to add the .modelContext modifier to the imageRenderer. I was not sure why that was needed as of 17.4, so I am a little in the dark as to how this code works and what to expect. |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's all new Paywall Editor allow you to remotely configure your paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.