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

# appendInterpolation(_:)

Appends an attributed string to a string interpolation.

## Declaration

```swift
mutating func appendInterpolation(_ attributedString: AttributedString)
```

## Parameters

- `attributedString`: The attributed string to append.

## 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 an AttributedString and append it to static text. The resulting interpolation implicitly creates a LocalizedStringKey, which a Text view uses to provide its content. struct ContentView: View {

var nextDate: AttributedString {         var result = Calendar.current             .nextWeekend(startingAfter: Date.now)!             .start             .formatted(                 .dateTime                 .month(.wide)                 .day()                 .attributed             )         result.backgroundColor = .green         result.foregroundColor = .white         return result     }

var body: some View {         Text("Our next catch-up is on \(nextDate)!")     } } For this example, assume that the app runs on a device set to a Russian locale, and has the following entry in a Russian-localized Localizable.strings file: "Our next catch-up is on %@!" = "Наша следующая встреча состоится %@!"; The attributed string nextDate replaces the format specifier %@,  maintaining its color and date-formatting attributes, when the Text view renders its contents:

## See Also

### Appending to an interpolation

- [appendInterpolation(_:specifier:)](swiftui/localizedstringkey/stringinterpolation/appendinterpolation(_:specifier:).md)
- [appendInterpolation(_:format:)](swiftui/localizedstringkey/stringinterpolation/appendinterpolation(_:format:).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)
