JanyGee / JGSwiftTimer

利用GCD定时器,解决Timer时间不准的情况

Home Page:https://github.com/JanyGee/JGSwiftTimer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JGSwiftTimer

Version License Platform Swift-5.0

JGSwiftTimer is a lightweight timer extension for Swift. OC

Installation

JGSwiftTimer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "JGSwiftTimer"

Usage

import JGTimer.h

Methods

executeTask(start: TimeInterval, interval: TimeInterval, repeats: Bool, async: Bool, task: @escaping ()->Void) -> String?

JGTimer.executeTask(start: 3, interval: 1, repeats: true, async: true, task: {self.doTask()})

executeTask(start: TimeInterval, interval: TimeInterval, repeats: Bool, async: Bool, target: AnyObject, selector: Selector) -> String?

JGTimer.executeTask(start: 1, interval: 1, repeats: true, async: true, target: self, selector: #selector(doTask))

About

利用GCD定时器,解决Timer时间不准的情况

https://github.com/JanyGee/JGSwiftTimer

License:MIT License


Languages

Language:Swift 100.0%