Код: Выделить всё
let background = DispatchQueue(label: "backgroundQueue",
qos: .background,
attributes: [],
autoreleaseFrequency: .inherit,
target: nil)
Код: Выделить всё
background.async {
DispatchQueue.main.sync {
print("Hello from background async")
}
}
Код: Выделить всё
background.sync {
DispatchQueue.main.sync {
print("Hello from background sync")
}
}
Подробнее здесь: https://stackoverflow.com/questions/695 ... ueue-succe
Мобильная версия