使用+号,直接插入,将Image当成Text初始化值

1.示例

Text("Hello ") + Text(Image(systemName: "star")) + Text(" World!")

demo

2.示例

(Text("Hello ") + Text(Image(systemName: "star")) + Text(" World!"))
    .foregroundColor(.blue)
    .font(.largeTitle)

demo

3.示例

Text("Goodbye ") + Text(Image(systemName: "star")) + Text(" World!")
    .foregroundColor(.blue)
    .font(.largeTitle)

demo 参考