Skip to content

GCD定时器的简单封装(GCD timer simple package)

Notifications You must be signed in to change notification settings

drenhart/MCGCDTimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

MCGCDTimer

GCD定时器的简单封装

采用Swift4语言编写,使用时直接将MCGCDTimer类拖到工程中就可以了.

使用

  • 开始定时器

      MCGCDTimer.shared.scheduledDispatchTimer(WithTimerName: "GCDTimer", timeInterval: 1, queue: .main, repeats: true) {
          //需要执行的代码
      }
    
  • 取消定时器

      MCGCDTimer.shared.cancleTimer(WithTimerName: "GCDTimer")
    
  • 检查定时器是否存在

      MCGCDTimer.shared.isExistTimer(WithTimerName: "GCDTimer")
    

MCGCDTimer

GCD timer simple package

Written using Swift4 language, when used directly drag class MCGCDTimer to your project.

Usage

  • Begin Timer

      MCGCDTimer.shared.scheduledDispatchTimer(WithTimerName: "GCDTimer", timeInterval: 1, queue: .main, repeats: true) {
          //code need to be execute
      }
    
  • Cancel Timer

    MCGCDTimer.shared.cancleTimer(WithTimerName: "GCDTimer")
    
  • Check if the timer exists

    MCGCDTimer.shared.isExistTimer(WithTimerName: "GCDTimer")
    

About

GCD定时器的简单封装(GCD timer simple package)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages