title: How to use view modifiers only available for iOS 14+ with deployment target of iOS 13
body: <p>How can you add a view modifier to a view when it's only available on iOS 14 but your app is available for iOS 13?</p>
  <p>For an example, <code>textCase(_)</code>. Section headers in iOS 14 are uppercase so to use the case of your header text you should set <code>.textCase(.none)</code> on your <code>Text</code>, but this didn't exist until iOS 14.</p>
  <pre><code>Section(header:
      Text(&quot;Header&quot;)
          .textCase(.none) //FIXME: 'textCase' is only available in iOS 14.0 or newer
          .font(.system(size: 14, weight: .bold))
          .foregroundColor(.secondary)
          .padding(.top, 50)
  )
  </code></pre>
  <p>Xcode offers some suggestions:</p>
  <ul>
  <li>Add if #available version check</li>
  <li>Add @available attribute</li>
  </ul>
  <p>If you use the #available version check, it wraps all of that scoped code with #available, so you'd have to duplicate all of that to add that one line of code. If you use @available you have to duplicate the entire body property or entire struct.</p>
  <p>I considered creating my own ViewModifier that would only apply it if iOS 14 but that gives this dreaded error:</p>
  <blockquote>
  <p>Function declares an opaque return type, but the return statements in
  its body do not have matching underlying types</p>
  </blockquote>
  <pre><code>struct CompatibleTextCaseModifier: ViewModifier {
      func body(content: Content) -&gt; some View {
          if #available(iOS 14.0, *) {
              return content
                  .textCase(.none)
          } else {
              return content
          }
      }
  }
  </code></pre>