Swift promises example code