HomeiOS Developmentios - Swift Job doesn't start execution on system however works in...

ios – Swift Job doesn’t start execution on system however works in simulator


I’ve an odd concern, I’ve the next operate in a view mannequin (not annotated with an actor) that is named from tableView(_:willDisplay:forRowAt:):

non-public func updateFontIfNeeded(for indexPath: IndexPath) {
    guard cellViewModels.worth.indices.accommodates(indexPath.merchandise) else { return }

    let cellViewModel = cellViewModels.worth[indexPath.item]
    let hasTask = getTask(for: indexPath) != nil

    print("Replace if wanted")

    let fontTask = Job {
        do {
            print("Begin Job")
            let font = strive await fontManager.getFont(for: cellViewModel.fontItem)
            cellViewModel.updateFont(with: font)
            removeTask(for: indexPath)
        } catch {
            print(error)
            removeTask(for: indexPath)
        }
    }

    print("Add job to dict")
    addTask(fontTask, for: indexPath)
}

On my system it looks like that job block doesn’t being execution since “Begin Job” just isn’t logged, nevertheless the remainder of the operate is logged appropriately “Replace if wanted” -> “Add job to dict”. It really works completely nicely on the simulator however on the system the Job very not often begins. What am I doing incorrect right here? I believed all duties begin robotically.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments