Does anyone know how to run this not in the main q...
# compose-ios
j
Does anyone know how to run this not in the main queue on Kotlin-side?
Copy code
Synchronous URL loading of <https://cache.massengeschmack.tv/img/mag/paddy58.jpg> should not occur on this application's main thread as it may lead to UI unresponsiveness. Please switch to an asynchronous networking API such as URLSession.
The affected code line is the following one:
Copy code
artwork.setValue(value = NSData.dataWithContentsOfURL(URLWithString(playbackArtwork)!!))
u
Using
withContext
if you are already in suspend function or using
launch
to offload the setting of the artwork value to the background. EItherway you should use
<http://Disaptchers.IO|Disaptchers.IO>
👍 1