title: How do you confirm a string only contains numbers in Swift?
body: <p>How can I check, if searchView contains just numbers?</p>
  
  <p>I found this:</p>
  
  <pre><code>if newText.isMatchedByRegex("^(?:|0|[1-9]\\d*)(?:\\.\\d*)?$") { ... }
  </code></pre>
  
  <p>but it checks if text contains any number. How can I do, that if all text contains just numbers in Swift?</p>