0

I want to have an outline color for my text in SwiftUI. This is the code and I do not find any modifier for this goal:

import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("Outline")
    }
}

The goal I want is like this:

enter image description here

HangarRash
  • 7,314
  • 5
  • 5
  • 32
  • 2
    most of the answers [here](https://stackoverflow.com/questions/57334125/how-to-make-text-stroke-in-swiftui) should help – Stoic Apr 17 '23 at 00:34
  • But those answers does not seem attacking the issue in right way, I mean we need a path or something like that for out line. – Swift.power.code Apr 17 '23 at 00:44
  • 2
    Does this answer your question? [How to make text stroke in SwiftUI?](https://stackoverflow.com/questions/57334125/how-to-make-text-stroke-in-swiftui). Specifically the [answer here](https://stackoverflow.com/a/62623596/20287183) works quite easily. – HangarRash Apr 17 '23 at 03:54
  • 1
    Also, once Apple adds proper support for `AttributedString` and `strokeColor`/`strokeWidth`, the more flexible solution will be [How do you stroke text using AttributedString in iOS 15?](https://stackoverflow.com/questions/70746438/how-do-you-stroke-text-using-attributedstring-in-ios-15). – HangarRash Apr 17 '23 at 04:09

0 Answers0