Created
April 8, 2024 15:58
-
-
Save SysCall97/9a4eaa0e83837838728f550a85ccd8d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UILabel { | |
func updateLabel(with newText: String) { | |
DispatchQueue.main.async { | |
// Update the text of the label on the main thread | |
self.text = newText | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment