2019-08-18a few seconds read (About 75 words)How to use function builder in Swift 5.1Issue #361 12345678910111213141516171819protocol Task {}struct Build: Task {}struct Test: Task {}@_functionBuilderpublic struct TaskBuilder { public static func buildBlock(_ tasks: Task...) -> [Task] { tasks }}public func run(@TaskBuilder builder: () -> [Task]) { MyManager.run(tasks: builder())}public func run(@TaskBuilder builder: () -> Task) { MyManager.run(tasks: [builder()])} 1234run { Build() Test()} Read more The Swift 5.1 features that power SwiftUI’s API #swift