Currently using Attributed String in Foundation we could have several text stylings in a long string by using something like this:
How do we achieve this in SwiftUI?
Yes we can concat string like this
But this static approach is not possible if we apply localisation in our app. Each language have different grammar which leads to different word structure.
How could we have a consistent "Hi there" in red color regardless of it's language?
Code Block attributedSentence.setAttributes(redTextAttributes, range: NSRange(location: 0, length: 3))
How do we achieve this in SwiftUI?
Yes we can concat string like this
Code Block Text("Hi there").foregroundColor(.red) + Text("how are you"?).foregroundColor(.blue)
But this static approach is not possible if we apply localisation in our app. Each language have different grammar which leads to different word structure.
How could we have a consistent "Hi there" in red color regardless of it's language?