I'm currently playing with closures and chained completions in Swift. I'm quite familiar with the C# style of async and await, so I was wondering how to "translate" the following snippet from C# to Swift.
public async Task SomeFunction(string inputString)
{
var first = await GetFirstVariableAsync(inputString);
var second = await GetSecondVariableAsync(first);
if (second == "some condition")
{
first = await GetFirstVariableAsync(inputString);
var second = await GetSecondVariableAsync(first);
}
}
Does Swift has a similar construct like await, to wait for a function to complete, without having to nest multiple completion blocks?
Thank you