Debouncer
Debouncer
为什么需要 您是否曾经开发过一个搜索应用程序?每次用户在文本框中输入一个字符时,您都需要发送一个请求。因此,当用户快速输入时,您只需在用户停止输入或输入速度减慢时才发送请求
它是如何工作的?
let debouncer = Debouncer(delay: 0.25) // You can pass the delay value here
debouncer.dispatch {
// Your request here
}