user1385809
user1385809

Reputation: 83

String interpolation with LocalizedStringKey

I use string catalog and I'm trying to make LocalizedStringKey interpolatable such as:

"\(a.localizedString()) · \(b.localizedString())"

I have localizedString implemented like this:

enum A {
  case a1
  case a2

  func localizedString() -> LocalizedStringKey {
    return "aa"
  }
}

However, it doesn't display the correct value but show string literals like "LocalizedStringKey(key: ...)". My question is how I should do the right string interpolation with LocalizedStringKey?

Upvotes: 0

Views: 36

Answers (0)

Related Questions