Created
October 10, 2017 10:35
-
-
Save dodikk/95960084ee8b12f683c226d315e46d90 to your computer and use it in GitHub Desktop.
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
func performChainOfCommands(_ commands: [Command], callback: Block) | |
{ | |
if (commands.isEmpty) | |
{ | |
callback(.fail) | |
} | |
let head = commands.first | |
let tail = commands[1..(commands.count - 1)] | |
req.perform(withSuccess: { callback(.success) }, failure: { performChainOfCommands: tail } ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment