Skip to content

Commit

Permalink
Merge pull request Quick#549 from sunshinejr/feature/swift_4.2
Browse files Browse the repository at this point in the history
Add swift version check for default runloop case name
  • Loading branch information
ikesyo authored Jun 26, 2018
2 parents c6e2ec2 + 4f3bc4b commit 3737558
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Nimble/Utils/Async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ internal class AwaitPromiseBuilder<T> {
self.trigger.timeoutSource.resume()
while self.promise.asyncResult.isIncomplete() {
// Stopping the run loop does not work unless we run only 1 mode
#if swift(>=4.2)
_ = RunLoop.current.run(mode: .default, before: .distantFuture)
#else
_ = RunLoop.current.run(mode: .defaultRunLoopMode, before: .distantFuture)
#endif
}

self.trigger.timeoutSource.cancel()
Expand Down

0 comments on commit 3737558

Please sign in to comment.