---
title: "appendInterpolation(_:format:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/localizedstringkey/stringinterpolation/appendinterpolation(_:format:)"
---

# appendInterpolation(_:format:)

Appends the formatted representation  of a nonstring type supported by a corresponding format style.

## Declaration

```swift
mutating func appendInterpolation<F>(_ input: F.FormatInput, format: F) where F : FormatStyle, F.FormatInput : Equatable, F.FormatOutput == AttributedString
```

## Parameters

- `input`: The instance to format and append.
- `format`: A format style to use when converting input into an attributed string representation.

## Discussion

Discussion Don’t call this method directly; it’s used by the compiler when interpreting string interpolations. The following example shows how to use a string interpolation to format a Date with a Date.FormatStyle and append it to static text. The resulting interpolation implicitly creates a LocalizedStringKey, which a Text uses to provide its content. Text("The time is \(myDate, format: Date.FormatStyle(date: .omitted, time:.complete).attributedStyle)")

## See Also

### Appending to an interpolation

- [appendInterpolation(_:)](swiftui/localizedstringkey/stringinterpolation/appendinterpolation(_:).md)
- [appendInterpolation(_:specifier:)](swiftui/localizedstringkey/stringinterpolation/appendinterpolation(_:specifier:).md)
- [appendInterpolation(_:formatter:)](swiftui/localizedstringkey/stringinterpolation/appendinterpolation(_:formatter:).md)
- [appendInterpolation(_:style:)](swiftui/localizedstringkey/stringinterpolation/appendinterpolation(_:style:).md)
- [appendInterpolation(timerInterval:pauseTime:countsDown:showsHours:)](swiftui/localizedstringkey/stringinterpolation/appendinterpolation(timerinterval:pausetime:countsdown:showshours:).md)
- [appendLiteral(_:)](swiftui/localizedstringkey/stringinterpolation/appendliteral(_:).md)
