<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Text/init(_:formatter:)-2he2c",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4TextV_9formatterACx_So11NSFormatterCtc10Foundation20ReferenceConvertibleRzlufc"
  },
  "title" : "init(_:formatter:)"
}
-->

# init(_:formatter:)

Creates a text view that displays the formatted representation
of a reference-convertible value.

```
init<Subject>(_ subject: Subject, formatter: Formatter) where Subject : ReferenceConvertible
```

## Parameters

`subject`

A
<doc://com.apple.documentation/documentation/Foundation/ReferenceConvertible>
instance compatible with `formatter`.

`formatter`

A
<doc://com.apple.documentation/documentation/Foundation/Formatter>
capable of converting `subject` into a string representation.

## Discussion

Use this initializer to create a text view that formats `subject`
using `formatter`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)