Skip to content

Instantly share code, notes, and snippets.

@dodikk
Created October 10, 2017 10:35
Show Gist options
  • Save dodikk/95960084ee8b12f683c226d315e46d90 to your computer and use it in GitHub Desktop.
Save dodikk/95960084ee8b12f683c226d315e46d90 to your computer and use it in GitHub Desktop.
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