title: How to make hyperlinks in SwiftUI
body: <p>In Swift, as shown <a href="https://stackoverflow.com/questions/39238366/uitextview-with-hyperlink-text">here</a>, you can use <code>NSMutableAttributedString</code> to embed links in text.</p>
  <p>How can I achieve this with <code>SwiftUI</code>?</p>
  <p>I implemented it as the following, but it does not look how I want it to. <img src="https://i.stack.imgur.com/2ALYN.png" alt="this" />.</p>
  <pre><code>import SwiftUI
  
  struct ContentView: View {
      var body: some View {
          HStack {
              Text(&quot;By tapping Done, you agree to the &quot;)
              Button(action: {}) {
                  Text(&quot;privacy policy&quot;)
              }
              Text(&quot; and &quot;)
              Button(action: {}) {
                  Text(&quot;terms of service&quot;)
              }
              Text(&quot; .&quot;)
          }
      }
  }
  </code></pre>