title: How to add an optional string extension?
body: <p>You can create a String extension like so:</p>
  <pre><code>extension String {
     func someFunc() -&gt; Bool { return true }
  }
  </code></pre>
  <p>but what if you want it to apply to optional string?</p>
  <pre><code>var optionalString: String? = &quot;&quot;
  optionalString!.someFunc() /* String? does not have a member someFunc */
  </code></pre>
  <p>Attempting to add <code>extension String? {</code> produces the error:</p>
  <blockquote>
  <p>Constrained extension must be declared on the unspecialized generic type 'Optional' with constraints specified by a 'where' clause</p>
  </blockquote>