Skip to content
/ Delay Public

Easy syntax to async with delay work with DispatchQueue

Notifications You must be signed in to change notification settings

deda9/Delay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Delay

In short it replaces this

DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1)) {
    //doing your work
}

with

delay(seconds: 1, thread: .main) {
    //doing your work
}

and replaces this

DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + .seconds(1)) {
    //doing your work
}

with

delay(seconds: 1, thread: .background(.default)) {
    //doing your work
}

Releases

No releases published

Packages

No packages published

Languages