3
1

More than 1 year has passed since last update.

SwiftUIのTextにマークダウンを使用する

Posted at

SwiftUIではmarkdownがサポートされているため、テキストを太字にしたり、リンクを組み込んだりすることができます。

使い方

var body: some View {
    VStack {
        Text("**Hello, world!**")
        Text("[Apple](https://www.apple.com/)")
        Text("~~striked through~~.")
    }
}

リンクの色を変更する

.tintを使用することでリンクの色を指定することができます。

Text("[Apple](https://www.apple.com/)")
    .tint(.red)
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1