Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Text link color swiftUI

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?

like image 552
Iker Solozabal Avatar asked Nov 19 '25 12:11

Iker Solozabal


2 Answers

It is possible to use accent color, like

Text(.init("[Link Example](https://www.google.es/)"))
    .accentColor(.red)
like image 129
Asperi Avatar answered Nov 21 '25 01:11

Asperi


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)
like image 29
Oluwatobi Omotayo Avatar answered Nov 21 '25 02:11

Oluwatobi Omotayo