Change Text link color swiftUI

Viewed 1798

I have the folowing Text() that takes markdown to show a link

Text(.init("[Link Example](https://www.google.es/)"))

Example of my text

Is there a way of changing the default color set to the link?

2 Answers

It is possible to use accent color, like

Text(.init("[Link Example](https://www.google.es/)"))
    .accentColor(.red)

You can achieve that with .tint(_:) as accentColor(_:) will soon be deprecated according to the documentation.

Text("[Link Example](https://www.google.es/)")
  .tint(Color.red)
Related