title: how to limit number ranges in textfields (swift4)
body: <p>The code below limits the user to enter into the textfeld just numbers. What I am trying to do is limit the user to enter a number between -359 to 359. No letters just a number between that range. </p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController,UITextFieldDelegate {
      @IBOutlet var juju : UITextField!
  
      func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -&gt; Bool {
          let aSet = NSCharacterSet(charactersIn:"0123456789").inverted
          let compSepByCharInSet = string.components(separatedBy: aSet)
          let numberFiltered = compSepByCharInSet.joined(separator: "")
          return string == numberFiltered
      }
  }
  </code></pre>