title
must be a LocalizedStringKey
. You may instantly use Picture
s as a part of its string interpolation:
var title: LocalizedStringKey {
swap self {
case .verse:
return "(Picture(systemName: "quote.opening")) verses"
case .chapter:
return "(Picture(systemName: "textual content.quote")) chapters"
}
}
Now you do not even want your personal .localized
. Observe that the localisation keys are %@ verses
and %@ chapters
, so change your xcstrings accordingly.
If you wish to use your personal .localized
for some purpose (you actually should not), title
may return a Textual content
,
var title: Textual content {
swap self {
case .verse:
return Textual content(Picture(systemName: "quote.opening")) + Textual content("verses".localized)
case .chapter:
return Textual content(Picture(systemName: "textual content.quote")) + Textual content("chapters".localized)
}
}