AwaitKit is a powerful Swift library which provides a powerful way to write asynchronous code in a sequential manner.

Overview

AwaitKit

Carthage Compatible Supported Platforms Version Build Status codecov.io codebeat badge Awesome

Have you ever dream to write asynchronous code like its synchronous counterpart?

AwaitKit is a powerful Swift library inspired by the Async/Await specification in ES8 (ECMAScript 2017) which provides a powerful way to write asynchronous code in a sequential manner.

Internally it uses PromiseKit v6.10 to create and manage promises.

RequirementsGetting StartedUsageInstallationContributionContactLicense

Requirements

  • iOS 8.0+
  • Xcode 8.0+
  • Swift 4.0+

Getting Started

If you want have a quick overview of the project take a look to this blog post.

Put simply, write this:

let user = try! await(signIn(username: "Foo", password: "Bar"))
try! await(sendWelcomeMailToUser(user))
try! await(redirectToThankYouScreen())

print("All done!")

Instead of:

signIn(username: "Foo", password: "Bar")
  .then { user in
    return self.sendWelcomeMailToUser(user)
  }
  .then { _ in
    return self.redirectToThankYouScreen()
  }
  .then { _ in
    print("All done!")
  }

Or worse, using the completion block imbrication hell style:

signIn(username: "Foo", password: "Bar") { user in
  self.sendWelcomeMailToUser(user) { _ in
    self.redirectToThankYouScreen() { _ in
      print("All done!")
    }
  }
}

Usage

Async

The async method yields the execution to its closure which will run in a background queue and returns a promise which will be resolved at this end of block.

Here a small example :

func setupNewUser(name: String) -> Promise {  
  return async {
    let newUser = try await(self.createUser(name))
    let friends = try await(self.getFacebookFriends(name))

    newUser.addFriends(friends)

    return newUser
  }
}

Here the setupNewUser returns a promise with a user as value. If the end of async block is executed the promise will be resolved, otherwise if an error occurred inside the async block the promise will be rejected with the corresponding error.

The async block will catch the error thrown to reject the promise so you don't need to manage the await exceptions. But if necessary, you can:

async {
  do {
    try await(self.loginOrThrown(username: "yannickl"))
  }
  catch {
    print(error)
  }

  try await(self.clearCache())
}

Await

The await method will executes the given promise or block and await until it resolved or failed.

do {
  let name: String = try await {
    Thread.sleep(forTimeInterval: 0.2)

    if Int(arc4random_uniform(2) + 1) % 2 == 0 {
      return "yannickl"
    }
    else {
      throw NSError()
    }
  }

  print(name)
}
catch {
  print(error)
}

Custom queues

The async and await methods runs by default on a background concurrent queue. Of course, you can choose your own queues and call the following methods:

DispatchQueue.global(qos: .default).ak.async {

}

try DispatchQueue.global(qos: .default).ak.await {

}

When you use these methods and you are doing asynchronous, be careful to do nothing in the main thread, otherwise you risk to enter in a deadlock situation.

Installation

The recommended approach to use AwaitKit in your project is using the CocoaPods package manager, as it provides flexible dependency management and dead simple installation.

CocoaPods

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup

Go to the directory of your Xcode project, and Create and Edit your Podfile and add AwaitKit:

$ cd /path/to/MyProject
$ touch Podfile
$ edit Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'AwaitKit', '~> 5.2.0'

Install into your project:

$ pod install

If CocoaPods did not find the PromiseKit 6.10 dependency execute this command:

$ pod repo update

Open your project in Xcode from the .xcworkspace file (not the usual project file)

$ open MyProject.xcworkspace

Swift Package Manager

You can use The Swift Package Manager to install AwaitKit by adding the proper description to your Package.swift file:

import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .Package(url: "https://github.com/yannickl/AwaitKit.git")
    ]
)

Note that the Swift Package Manager is still in early design and development, for more information checkout its GitHub Page.

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate AwaitKit into your Xcode project using Carthage, specify it in your Cartfile:

5.2.0 ">
github "yannickl/AwaitKit" ~> 5.2.0

Run carthage update to build the framework and drag the built AwaitKit.framework into your Xcode project.

Manually

Download the project and copy the AwaitKit folder into your project to use it in. Note that you also need to download the PromiseKit v6.7 library and import it to your project.

Contribution

Contributions are welcomed and encouraged .

Contact

Yannick Loriot

License (MIT)

Copyright (c) 2016-present - Yannick Loriot

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Crashing on iOS11 device

    Crashing on iOS11 device

    Hello @yannickl,

    Love the framework, great work! Maybe it is connected to #16, building the app with the iOS11 SDK, it crashes on the device (not on simulator, though).

    • 0 : "0 ??? 0x0000000109880474 0x0 + 4454876276"
    • 1 : "1 App Development 0x0000000103e11e1c main + 0"
    • 2 : "2 AwaitKit 0x0000000104721ca0 _T08AwaitKit9ExtensionCAASo13DispatchQueueCRbzlE5awaitqd__07PromiseB00G0Cyqd__GKlF + 2020"
    • 3 : "3 AwaitKit 0x0000000104720810 _T08AwaitKit5awaitx07PromiseB00D0CyxGKlF + 172"
    • 4 : "4 App Development 0x0000000103e110e0 T019App_Development11AppDelegateC11applicationSbSo13UIApplicationC_s10DictionaryVySo0F16LaunchOptionsKeyVypGSg022didFinishLaunchingWithI0tFyycfU + 352"
    • 5 : "5 AwaitKit 0x00000001047211f0 _T0s5Error_pIxzo_ytsAA_pIxrzo_TR + 32"
    • 6 : "6 AwaitKit 0x00000001047212e4 _T0s5Error_pIxzo_ytsAA_pIxrzo_TRTA + 88"
    • 7 : "7 PromiseKit 0x00000001069820ac T0So13DispatchQueueC10PromiseKitE7promiseAC0C0CyxGSo0A5GroupCSg5group_0A00A3QoSV3qosAL0A13WorkItemFlagsV5flagsxyKc7executetlFyyAC10ResolutionOyxGccfU_yycfU + 216"
    • 8 : "8 PromiseKit 0x00000001069737b0 _T0Ix_IyB_TR + 48"
    • 9 : "9 libdispatch.dylib 0x000000010764f334 _dispatch_block_async_invoke_and_release + 100"
    • 10 : "10 libdispatch.dylib 0x0000000107641d4c _dispatch_client_callout + 16"
    • 11 : "11 libdispatch.dylib 0x000000010764f9a0 _dispatch_continuation_pop + 624"
    • 12 : "12 libdispatch.dylib 0x000000010764de48 _dispatch_async_redirect_invoke + 684"
    • 13 : "13 libdispatch.dylib 0x0000000107654080 _dispatch_root_queue_drain + 616"
    • 14 : "14 libdispatch.dylib 0x0000000107653db8 _dispatch_worker_thread4 + 68"
    • 15 : "15 libsystem_pthread.dylib 0x00000001864bf338 _pthread_wqthread + 1260"
    • 16 : "16 libsystem_pthread.dylib 0x00000001864bee40 start_wqthread + 4"

    The exception brake point stops at DispatchQueue+AwaitKit,swift line 79.

    opened by eriadam 13
  • Fails to build using carthage

    Fails to build using carthage

    I've been trying to build this library, using Carthage, but it's failed with error: error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. Is something can be done about it?

    opened by ghost 7
  • XCode 10.2 compatibility

    XCode 10.2 compatibility

    It's not possible to build the project with XCode 10.2:

    The target “PromiseKit” contains source code developed with Swift 3.x. 
    This version of Xcode does not support building or migrating Swift 3.x targets.
    
    opened by martinbonnin 6
  • Patch release for package.swift change

    Patch release for package.swift change

    Any chance of a patch release with the package.swift update? It's not possible to add this as a dependency currently without it. Commit hash is ad8e892d934046799f5767293f19cfd616302b8c.

    opened by jnewc 6
  • Multi-Platform support

    Multi-Platform support

    • Added support for macOS, tvOS and watchOS.
    • Bumped the version of the PromiseKit dependency.
    • Replaced the previous project with another one which includes framework and test targets for all the supported platforms.
    • Updated the Travis CI script.
    • Removed the AwaitKit class to avoid conflicts with the AwaitKit namespace.
    • Moved the methods from the DispatchQueue extensions to the main file because Swift wrongly detects ambiguous use for them.
    • Updated the .gitignore file to include the Pods so that the Travis builds will be faster and won’t time out.
    opened by arturgrigor 6
  • Carthage support

    Carthage support

    Changes

    • Updated the .gitignore file.
    • Added the PromiseKit dependency as a submodule.
    • Updated the Travis CI config.
    • Bumped the podspec version.
    • Upgraded the dependency to the latest version.
    • Created an Xcode project just for the framework because Carthage needs it.
    • Created a single framework target and a single framework tests target for all the supported platforms just like PromiseKit has.
    • Updated the Example project and it's Podfile.
    • Updated the README.md file to reflect the Carthage support.
    opened by arturgrigor 4
  • Simple URLSession example not working

    Simple URLSession example not working

    Proof of concept with using AwaitKit, I'm using URLSession.dataTask to perform a request and get a response, asynchronously and non-blocking (so, by using async { } in a background thread).

    This code is the first code in viewDidLoad in the default ViewController in a new project.

    func doRequest() -> Promise<URLResponse?> {
        return Promise { resolve, reject in
            URLSession.shared.dataTask(with: URL(string: "https://httpstat.us/200?sleep=1000")!) { (data, response, error) in        
                if (error != nil) {
                    return reject(error!)
                }
                    
                return resolve(response)
            }
        }
    }
        
    async {
        let response = try await(doRequest())
        print(response)
    }
    

    However, we never get to print(response), no errors are thrown, nothing happens. Am I using this library correctly?

    opened by J7mbo 3
  • DispatchQueue.async ambiguous in swift 3.0

    DispatchQueue.async ambiguous in swift 3.0

    The DispatchQueue extension in this library which adds the .async method conflicts with the one provided by swift 3.0 (dispatch_async was replaced with DispatchQueue.async). Explicitly specifying the parameter name (execute:) works around the issue but I think this extension method needs to be renamed so that it does not conflict with iOS standard libs.

    enhancement 
    opened by crfeliz 3
  • Error : Command failed due to signal : Segmentation fault: 11

    Error : Command failed due to signal : Segmentation fault: 11

    i'm run in Simulator it's work fine. but i'm run Arachive, there some errors that:

    Error : Command failed due to signal : Segmentation fault: 11

    0 swift 0x0000000109f7366b llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43 1 swift 0x0000000109f72956 llvm::sys::RunSignalHandlers() + 70 2 swift 0x0000000109f73ccf SignalHandler(int) + 287 3 libsystem_platform.dylib 0x00007fff9865f52a _sigtramp + 26 4 libsystem_platform.dylib 0x00000000000003b4 _sigtramp + 1738149540 5 swift 0x0000000107e0f16d emitApplyArgument((anonymous namespace)::IRGenSILFunction&, swift::SILValue, swift::SILParameterInfo, swift::irgen::Explosion&) + 365 6 swift 0x0000000107e0e971 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 2497 7 swift 0x0000000107dfc23b swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction) + 9787 8 swift 0x0000000107d575c8 swift::irgen::IRGenModuleDispatcher::emitGlobalTopLevel() + 600 9 swift 0x0000000107de304e performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl, swift::SILModule, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile, unsigned int) + 1278 10 swift 0x0000000107de34f6 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 70 11 swift 0x0000000107cc6c8c performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef, int&) + 15004 12 swift 0x0000000107cc268d frontend_main(llvm::ArrayRef, char const, void) + 2781 13 swift 0x0000000107cbe0ac main + 1932 14 libdyld.dylib 0x00007fff8dbee5ad start + 1 15 libdyld.dylib 0x000000000000006a start + 1916869310 Stack dump:

    opened by arden 3
  • cocoaspod 0.39 with awaitkit

    cocoaspod 0.39 with awaitkit

    i'm use cocoaspod 0.39, when i'm run pod update, there some errors below: [!] Unable to find a specification for AwaitKit (~> 1.0.0)

    the awaitkit must to use cocoapod 1.0.0?

    opened by arden 3
  • Support Swift 5.5 / Xcode 13

    Support Swift 5.5 / Xcode 13

    The introduction of async/await in Swift 5.5 (https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md) promoted the "await" word to keyword. Therefore to use it in this context, it must be wrapped in backticks.

    Change is compatible with previous Swift versions.

    opened by siejkowski 2
  • AwaitKit doesn't compile in Xcode 13 / Swift 5.5

    AwaitKit doesn't compile in Xcode 13 / Swift 5.5

    The introduction of async/await in Swift 5.5 (https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md) promoted the "await" word to keyword. Therefore to use it in the context of function call, it must be wrapped in backticks, just as for the methods called with other language keywords.

    I've made a PR that adds the backticks in the right place: https://github.com/yannickl/AwaitKit/pull/57

    Change is compatible with previous Swift versions.

    opened by siejkowski 11
  • Installation with CocoaPods Works but with Carthage doesn't by Xcode 12.4

    Installation with CocoaPods Works but with Carthage doesn't by Xcode 12.4

    The code is like this

    import UIKit
    import PromiseKit
    import AwaitKit
    
    class ViewController: UIViewController {
    
        override func viewDidLoad() {
            super.viewDidLoad()
            
            let urlRequest = URLRequest(url: URL(string: "https://zhaoxin.pro")!)
            
            if let (data, response) = try? await(URLSession.shared.dataTask(.promise, with: urlRequest)) { 
                let httpURLResponse = response as! HTTPURLResponse
            }
        }
    }
    

    on the if line, ".../ViewController.swift:19:40: Type of expression is ambiguous without more context" with Carthage build with xcframework.

    With CocoaPods, everything is fine.

    opened by owenzhao 0
  • How to convert a function with complete handler to async/await

    How to convert a function with complete handler to async/await

    I have a function:

    func find(name: String, complete: (([Result])->Void))

    I want to convert to a function something like this:

    func find(name: String) -> Promise<Element?> {
            find(name: name) {
                (result) in
                switch result {
                case .success(let elements):
                    if let element = elements {
                        // ??? How to return the element
                    }
                case .failure(let error):
                    print(error)
                    // ??? How to return nil
                }
            }
    }
    

    The example is really simple one. Can AwaitKit used for the case like my example?

    opened by zhouhao27 1
  • iOS 12 is the minimum SDK for PromiseKit

    iOS 12 is the minimum SDK for PromiseKit

    As the title suggests, though AwaitKit is still supporting iOS 8. PromiseKit requires that the SDK must be later than iOS 12. And Xcode will show an error when building with AwaitKit.

    opened by owenzhao 0
  • AwaitKit causes unit tests to fail

    AwaitKit causes unit tests to fail

    I've have installed AwaitKit in a project, however have not started to implement it. The addition of it however has now started my Unit Test's to fail with -

    Main Thread Checker: UI API called on a background thread: -[UIViewController init]
    PID: 10379, TID: 237476, Thread name: (none), Queue name: com.yannickloriot.asyncqueue, QoS: 0
    Backtrace:
    4   OAuthKit                            0x000000010a61fc33 $sSo16UIViewControllerCABycfcTO + 19
    5   OAuthKit                            0x000000010a61c57f $sSo16UIViewControllerCABycfC + 31
    6   OAuthKit                            0x000000010a61c2be $s8OAuthKit0A8ProviderC06createA7Manager33_430562AB130E806488074CBA323B7784LL0A5Swift06OAuth2J0CyF + 1470
    7   OAuthKit                            0x000000010a618657 $s8OAuthKit0A8ProviderCACycfc + 775
    8   OAuthKit                            0x000000010a6182ec $s8OAuthKit0A8ProviderCACycfC + 60
    9   SomeAppName                          0x000000010a2018fb $s10SomeAppName16CoreDependenciesC13oauthProvider33_68CD4A43F5E2D568288F593D3DE6E3FCLL8OAuthKit0rG4Type_pvg + 539
    10  SomeAppName                          0x000000010a201c53 $s10SomeAppName16CoreDependenciesC7authSvcAA15AuthServiceType_pvg + 547
    11  SomeAppName                          0x000000010a202230 $s10SomeAppName16CoreDependenciesCAA10DependencyA2aDP7authSvcAA15AuthServiceType_pvgTW + 16
    12  SomeAppName                          0x000000010a1f6b2e $s10SomeAppName15StartInteractorC14checkAuthState10PromiseKit0I0CyytGyF + 238
    13  SomeAppName                          0x000000010a1f6cf9 $s10SomeAppName15StartInteractorCAA0D7UseCaseA2aDP14checkAuthState10PromiseKit0K0CyytGyFTW + 9
    14  SomeAppName                          0x000000010a1f7517 $s10SomeAppName14StartPresenterC14checkAuthState33_A43D4EBCFE4D52FAD1D88C1B3EB067FBLLyyFyyKcfU_ + 87
    15  SomeAppName                          0x000000010a1f7674 $s10SomeAppName14StartPresenterC14checkAuthState33_A43D4EBCFE4D52FAD1D88C1B3EB067FBLLyyFyyKcfU_TA + 20
    16  AwaitKit                            0x000000010a5b53ef $ss5Error_pIegzo_ytsAA_pIegrzo_TR + 15
    17  AwaitKit                            0x000000010a5b5484 $ss5Error_pIegzo_ytsAA_pIegrzo_TRTA + 20
    18  PromiseKit                          0x000000010a881943 $sSo17OS_dispatch_queueC10PromiseKitE5async_5group3qos5flags7executeAC0D0CyxGAC13PMKNamespacerO_So0a1_b1_G0CSg8Dispatch0L3QoSVAQ0L13WorkItemFlagsVxyKctlFyycfU_ + 275
    19  PromiseKit                          0x000000010a856bcd $sIeg_IeyB_TR + 45
    20  libdispatch.dylib                   0x00007fff516ba274 _dispatch_block_async_invoke2 + 83
    21  libdispatch.dylib                   0x00007fff516ad781 _dispatch_client_callout + 8
    22  libdispatch.dylib                   0x00007fff516afb3d _dispatch_continuation_pop + 440
    23  libdispatch.dylib                   0x00007fff516af209 _dispatch_async_redirect_invoke + 817
    24  libdispatch.dylib                   0x00007fff516bcbfc _dispatch_root_queue_drain + 350
    25  libdispatch.dylib                   0x00007fff516bd39e _dispatch_worker_thread2 + 99
    26  libsystem_pthread.dylib             0x00007fff518d16d5 _pthread_wqthread + 220
    27  libsystem_pthread.dylib             0x00007fff518d157b start_wqthread + 15
    2019-11-22 05:23:06.834770+0000 SomeAppName[10379:237476] [reports] Main Thread Checker: UI API called on a background thread: -[UIViewController init]
    PID: 10379, TID: 237476, Thread name: (none), Queue name: com.yannickloriot.asyncqueue, QoS: 0
    Backtrace:
    4   OAuthKit                            0x000000010a61fc33 $sSo16UIViewControllerCABycfcTO + 19
    5   OAuthKit                            0x000000010a61c57f $sSo16UIViewControllerCABycfC + 31
    6   OAuthKit                            0x000000010a61c2be $s8OAuthKit0A8ProviderC06createA7Manager33_430562AB130E806488074CBA323B7784LL0A5Swift06OAuth2J0CyF + 1470
    7   OAuthKit                            0x000000010a618657 $s8OAuthKit0A8ProviderCACycfc + 775
    8   OAuthKit                            0x000000010a6182ec $s8OAuthKit0A8ProviderCACycfC + 60
    9   SomeAppName                          0x000000010a2018fb $s10SomeAppName16CoreDependenciesC13oauthProvider33_68CD4A43F5E2D568288F593D3DE6E3FCLL8OAuthKit0rG4Type_pvg + 539
    10  SomeAppName                          0x000000010a201c53 $s10SomeAppName16CoreDependenciesC7authSvcAA15AuthServiceType_pvg + 547
    11  SomeAppName                          0x000000010a202230 $s10SomeAppName16CoreDependenciesCAA10DependencyA2aDP7authSvcAA15AuthServiceType_pvgTW + 16
    12  SomeAppName                          0x000000010a1f6b2e $s10SomeAppName15StartInteractorC14checkAuthState10PromiseKit0I0CyytGyF + 238
    13  SomeAppName                          0x000000010a1f6cf9 $s10SomeAppName15StartInteractorCAA0D7UseCaseA2aDP14checkAuthState10PromiseKit0K0CyytGyFTW + 9
    14  SomeAppName                          0x000000010a1f7517 $s10SomeAppName14StartPresenterC14checkAuthState33_A43D4EBCFE4D52FAD1D88C1B3EB067FBLLyyFyyKcfU_ + 87
    15  SomeAppName                          0x000000010a1f7674 $s10SomeAppName14StartPresenterC14checkAuthState33_A43D4EBCFE4D52FAD1D88C1B3EB067FBLLyyFyyKcfU_TA + 20
    16  AwaitKit                            0x000000010a5b53ef $ss5Error_pIegzo_ytsAA_pIegrzo_TR + 15
    17  AwaitKit                            0x000000010a5b5484 $ss5Error_pIegzo_ytsAA_pIegrzo_TRTA + 20
    18  PromiseKit                          0x000000010a881943 $sSo17OS_dispatch_queueC10PromiseKitE5async_5group3qos5flags7executeAC0D0CyxGAC13PMKNamespacerO_So0a1_b1_G0CSg8Dispatch0L3QoSVAQ0L13WorkItemFlagsVxyKctlFyycfU_ + 275
    19  PromiseKit                          0x000000010a856bcd $sIeg_IeyB_TR + 45
    20  libdispatch.dylib                   0x00007fff516ba274 _dispatch_block_async_invoke2 + 83
    21  libdispatch.dylib                   0x00007fff516ad781 _dispatch_client_callout + 8
    22  libdispatch.dylib                   0x00007fff516afb3d _dispatch_continuation_pop + 440
    23  libdispatch.dylib                   0x00007fff516af209 _dispatch_async_redirect_invoke + 817
    24  libdispatch.dylib                   0x00007fff516bcbfc _dispatch_root_queue_drain + 350
    25  libdispatch.dylib                   0x00007fff516bd39e _dispatch_worker_thread2 + 99
    26  libsystem_pthread.dylib             0x00007fff518d16d5 _pthread_wqthread + 220
    27  libsystem_pthread.dylib             0x00007fff518d157b start_wqthread + 15
    (lldb) 
    

    The only way around this for now is to disable the main thread checker in my test scheme, which I'd rather not do. I'm a little confused as to why this is happening and how to fix it.

    opened by t3ddyK 1
Owner
Yannick Loriot
iOS developer and nodejs addict. Open-source lover and technology enthusiast.
Yannick Loriot
Futures is a cross-platform framework for simplifying asynchronous programming, written in Swift.

Futures Futures is a cross-platform framework for simplifying asynchronous programming, written in Swift. It's lightweight, fast, and easy to understa

David Ask 60 Aug 11, 2022
Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch

Async Now more than syntactic sugar for asynchronous dispatches in Grand Central Dispatch (GCD) in Swift Async sugar looks like this: Async.userInitia

Tobias Due Munk 4.6k Dec 27, 2022
Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch (iOS7+ and OS X 10.9+ compatible)

Async.legacy Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch (GCD) Async rewritten for iOS7 and OS X 10.9 Compatibility

Joseph Lord 31 Jul 1, 2019
AsyncTimer is a precision asynchronous timer. You can also use it as a countdown timer

AsyncTimer ?? Features Can work as a countdown timer Can work as a periodic Timer Can work as a scheduled timer Working with user events (like: scroll

Adrian Bobrowski 26 Jan 1, 2023
AsyncButton is the simple way to run concurrent code in your views.

SwiftUI AsyncButton ??️ AsyncButton is a Button capable of running concurrent code. Usage AsyncButton has the exact same API as Button, so you just ha

Lorenzo Fiamingo 13 Dec 14, 2022
Pomodoro is a macOS status bar application written in SwiftUI, which allows you to control your work and break time, exploiting the pomodoro-technique.

Pomodoro Pomodoro is a macOS status bar application which allows you to control your work and break time. Through this application you will be able to

Cristian Turetta 7 Dec 28, 2022
Egg Timer app helps you to cook your egg in the way you want

Egg Timer Egg Timer app helps you to cook your egg in the way you want. You need to decide on how do you want to eat your egg than just click the egg

Emrullah Cirit 2 Nov 29, 2022
New Way Of Working Around With Closures.

Closured New Way Of Working Around With Closures. Are you tired of old-school callback closures? Are you always mess up with capturing references on a

Kiarash Vosough 8 Sep 18, 2022
Sample code from an NSScreencast episode

Sample Code This code is part of an NSScreencast episode. Sample code is released under the MIT license (see below), except for 3rd party code (typica

NSScreencast 0 Dec 15, 2021
Hydra ⚡️ Lightweight full-featured Promises, Async & Await Library in Swift

Lightweight full-featured Promises, Async & Await Library in Swift What's this? Hydra is full-featured lightweight library which allows you to write b

Daniele Margutti 2k Dec 24, 2022
Kommander is a Swift library to manage the task execution in different threads.

A lightweight, pure-Swift library for manage the task execution in different threads. Through the definition a simple but powerful concept, Kommand.

Intelygenz 173 Apr 11, 2022
AutoLogout is a swift library for managing user's session on inactivity.

On user inactivity, it will show an alert box to continue session or Logout as shown in screen shot, according to time set.

Adnan Yousaf 9 Jul 7, 2022
An actor model library for swift.

Aojet Aojet is an actor model implemetion for swift. Features Asynchronous, non-blocking and highly performant message-driven programming model Safe a

null 37 Apr 7, 2022
Hydra: Lightweight full-featured Promises, Async-Await Library in Swift

Async Functions for ECMAScript The introduction of Promises and Generators in EC

Ecma TC39 1.6k Oct 17, 2022
A declarative state management and dependency injection library for SwiftUI x Concurrency

A declarative state management and dependency injection library for SwiftUI x Concurrency

Ryo Aoyama 199 Jan 1, 2023
Lightweight async/await networking library with interceptor support - usable from iOS 13+.

Lightweight async/await networking library with interceptor support. ?? Getting started AsyncNetwork's session acts as a wrapper to URLSession by addi

Paul 9 Oct 4, 2022
A complete set of primitives for concurrency and reactive programming on Swift

A complete set of primitives for concurrency and reactive programming on Swift 1.4.0 is the latest and greatest, but only for Swift 4.2 and 5.0 use 1.

AsyncNinja 156 Aug 31, 2022
SwiftCoroutine - Swift coroutines for iOS, macOS and Linux.

Many languages, such as Kotlin, Go, JavaScript, Python, Rust, C#, C++ and others, already have coroutines support that makes the async/await pattern i

Alex Belozierov 808 Dec 1, 2022
Venice - Coroutines, structured concurrency and CSP for Swift on macOS and Linux.

Venice provides structured concurrency and CSP for Swift. Features Coroutines Coroutine cancelation Coroutine groups Channels Receive-only chan

Zewo 1.5k Dec 22, 2022