Hello friends. In this article, I will tell you about an error that occurs when processing with Swift. This error appears as follows.
UILabel.text must be used from main thread only
Since a separate thread is opened for data extraction from the web service and you then update the UI via this thread, you actually encounter this error. For this, you need to run it with DispatchQueue.main.async. Apple explains this very well in their documentation. If you want more information, you can find it here.
If you have questions, you can reach us by sending an e-mail or comment. Good work.