> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/swift/attributes/result-builders/various-result-types.md).

# various result types

[Swift](/ios/swift.md) ⟩ [Attributes](/ios/swift/attributes.md) ⟩ [Result Builders](/ios/swift/attributes/result-builders.md) ⟩

{% tabs %}
{% tab title="💈範例" %}

```swift
typealias Component = String

// result type: String
static func buildFinalResult(_ component: Component) -> String {
    return component
}

// result type: Int
static func buildFinalResult(_ component: Component) -> Int {
    return component.count
}
```

{% endtab %}

{% tab title="📗 參考" %}

* [x] Swift Senpai ⟩ [Swift Result Builders: The Basics You Need to Know!](https://swiftsenpai.com/swift/result-builders-basics/)
  {% endtab %}
  {% endtabs %}
