|
I'm trying to get a web page, parse it and return a value extracted from it. I'm getting this error. I don't really understand what I'm doing wrong. I am absolutely sure that the variable pensionAge will always be available and never go away, if that's relevant. Any tips gratefully received. Jeremy func getPensionAge(dob: Date, pensionAge: inout String) {
} |
|
I'm not sure why you're using an Perhaps something like this:
And then in the code that calls |
|
I wasn't returning a value because, as I understood it, the function would return before the URL analysis had been done by the separate thread. Thanks for your code: very interesting. Jeremy |
|
Yeah, sorry "return a |
|
As it turns out, the simple approach was to take my version, stick it in a class coforming to ObservableObject and declare pensionAge to be @Published. But I have learned a bit by reading your suggestion, so thanks again. Jeremy |
|
yeah,As it turns out, stick it in a class coforming to ObservableObject and declare pensionAge to be @Published. lisahaley |
SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.