Change (optional)
@MainActor
func updateSomeUI() {
assert(Thread.isMainThread) // Assertion failed!
}
to
func updateSomeUI() {
assert(Thread.isMainThread) // Assertion failed!
}
Then
class UpdateObject {
func fetchSomeData(completion: @escaping (_ success: Bool) -> Void) {
DispatchQueue.global().async {
completion(true)
}
}
}
to
class UpdateObject {
func fetchSomeData(completion: @escaping (_ success: Bool) -> Void) {
Task { @MainActor in
completion(true)
}
}
}
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: