title: iOS: how to check if a string has only digits?
body: <p>I need to determine if a text is an email address, or mobile number, for email address I can use some regular expression, for mobile number I can check if the string has only digits(right?)</p>
  
  <p>and the sequence is like:</p>
  
  <pre><code>is (regex_valid_email(text))
  {
      // email
  }
  else if (all_digits(text))
  {
      // mobile number
  }
  </code></pre>
  
  <p>but how do I check if a string has only numbers in iOS?</p>
  
  <p>Thanks</p>