Swift Version of Blocks