Skip to content

JanyGee/JGSwiftTimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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))