Skip to content

一个GCD 封装,用于过滤太过频繁的方法调用,比如搜索栏文字更改回调

License

Notifications You must be signed in to change notification settings

ZhangLi98745/GCDThrottle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GCDThrottle

License

目的

使用一个时间阈值来限制方法调用频率,可以用在搜索时候的文本变化过滤

用法

import Foundation
import Dispatch

@implementation ViewController

    @IBAction func textValueChanged(_ sender: UITextField) {
        GCDThrottle.throttle(0.5/* time */) {
            //do something
        }
    }

About

一个GCD 封装,用于过滤太过频繁的方法调用,比如搜索栏文字更改回调

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages