Created
March 10, 2018 11:02
-
-
Save mgrebenets/0f51d4036a48ca31f1178f14aab66e65 to your computer and use it in GitHub Desktop.
Async Swift Scripting - 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Alamofire | |
var keepAlive = true | |
Alamofire.request("http://httpbin.org/get") | |
.responseJSON { response in | |
print(response) // Result of response serialization | |
keepAlive = false | |
} | |
let runLoop = NSRunLoop.currentRunLoop() | |
while keepAlive && | |
runLoop.runMode(NSDefaultRunLoopMode, beforeDate: NSDate(timeIntervalSinceNow: 0.1)) { | |
// Run, run, run | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment