Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftresult buildersSingle-choice MCQ

Why does a `for` loop inside a result-builder body require a specific builder method, and which one, for the loop to be valid?

@resultBuilder struct StringBuilder { static func buildBlock(_ parts: String...) -> String { parts.joined() } } @StringBuilder func make() -> String { for n in 1...3 { "\(n)" } }