📜  debounce runloop siwft - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:31.606000             🧑  作者: Mango

代码示例1
let sub = NotificationCenter.default
    .publisher(for: NSControl.textDidChangeNotification, object: filterField)
    .debounce(for: .milliseconds(500), scheduler: RunLoop.main)
    .subscribe(on: RunLoop.main)
    .assign(to:\MyViewModel.filterString, on: myViewModel)