medium10 pts · first answer countsswift-concurrencyuikit
Updating UI from a detached task
What is wrong with this UIKit code?
func refresh() {
Task.detached {
let items = await self.api.fetchItems()
self.items = items
self.tableView.reloadData()
}
}Discussion 0
Join free to post in the discussion.
Related questions
- What await means in SwiftMobile App Developer
- viewDidLoad vs viewWillAppearMobile App Developer
- Using a SwiftUI view in UIKitMobile App Developer
- SwiftUI .task when leaving a screenMobile App Developer
- Wrapping a UIKit view in SwiftUIMobile App Developer
- Actor reentrancy in an image cacheMobile App Developer
- Task vs Task.detachedMobile App Developer
- Wrong photo in a reused cellMobile App Developer