Currently, I'm playing with the closure and strings Swift. I am very familiar with the style C# asyncand await, therefore, I was wondering how to "translate" the next fragment 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 it have a Swiftsimilar construction, such as awaitto wait for a function to complete without having to embed multiple completion blocks?
thank
nor0x source
share