title: Displaying an empty view in SwiftUI
body: <p>In SwiftUI there's frequently a need to display an "empty" view based on some condition, e.g.:</p>
  
  <pre class="lang-swift prettyprint-override"><code>struct OptionalText: View {
    let text: String?
  
    var body: some View {
      guard let text = text else { return }
  
      return Text(text) 
    }
  }
  </code></pre>
  
  <p>Unfortunately, this doesn't compile since the body of <code>guard</code> has to return some view, that is an "empty" view when <code>text</code> is <code>nil</code>. How should this example be rewritten so that it compiles and renders an "empty" view when <code>text</code> is <code>nil</code>?</p>