title: iOS App Crashes on every device except devices connected with Xcode
body: <p>My app crashes and quit when user try to register a new account but that occurs on any device except devices deployed the app with Xcode.</p>
  
  <p>All the devices are registered in the developer account and running iOS 11.4.1</p>
  
  <p>Here is the register button function:</p>
  
  <pre><code>@IBAction func regButton(_ sender: Any) {
  
      usernameText = usernameTextField.text
      mobileText = mobileTextField.text
      emailText = emailTextField.text
      passwordText = passwordTextField.text
      fieldText = categoryTextField.text
  
      print(usernameText ?? "damn")
      print(mobileText ?? "damn")
      print(emailText ?? "damn")
      print(passwordText ?? "damn")
      print(fieldText ?? "damn")
  
      if(type=="Seeker")
      {
          let url1 = "http://app.alosboiya.com.sa/hourjob.asmx/insert_jobseeker?name="+usernameText!+"&amp;phone="+mobileText!
  
          let url2 = "&amp;email="+emailText!+"&amp;password="+passwordText!+"&amp;workex="+"companyDescText!"
  
          let url3 = "&amp;category="+fieldText!+"&amp;image="+"downloadURLGlobal!"
  
          let url4 = "&amp;unpaidhour="+"string"+"&amp;hourpaidlast30="+"string"+"&amp;totalhourworked="+"string"+"&amp;balance="+"string"+"&amp;username="+usernameText!
  
          stringURL = url1 + url2 + url3 + url4
      }else
      {
          let url1 = "http://app.alosboiya.com.sa/hourjob.asmx/insert_company?name="+usernameText!+"&amp;field="+fieldText!
  
          let url2 = "&amp;phone="+mobileText!+"&amp;email="+emailText!+"&amp;password="+passwordText!+"&amp;workex="+"companyDescText!"+"&amp;crcopy="+"downloadURLGlobal!"+"&amp;logo="+"string"+"&amp;username="+usernameText!
  
          stringURL = url1 + url2
      }
  
      if Reachability.isConnectedToNetwork()
      {
  
          if(checkbox.on==true)
          {
  
          let url = URL(string: stringURL!)
          Alamofire.request(url!).responseString {
  
              (response) in
  
              let result = response.result.value
              do {
                  if(result=="True")
                  {
  
                      let alert = UIAlertController(title: "Registration Successfully", message: "Registration Done Successfully Congratulations",
                                                    preferredStyle: UIAlertControllerStyle.alert)
                      alert.addAction(UIAlertAction(title: "OK", style:
                          UIAlertActionStyle.default, handler: self.doSomething))
                      self.present(alert, animated: true, completion: nil)
  
  
  
                  }else
                  {
                      let alert = UIAlertController(title: "Registration Failed", message: "Registration Failed Please Try Again", preferredStyle: UIAlertControllerStyle.alert)
  
                      alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: { (action) in
                          alert.dismiss(animated: true, completion: nil)
                      }))
  
                      self.present(alert, animated: true, completion: nil)
                  }
  
              }
  
          }
  
      }else
          {
              let alert = UIAlertController(title: "License Agreement", message: "Check to Agree Licence Agreement", preferredStyle: UIAlertControllerStyle.alert)
  
              alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: { (action) in
                  alert.dismiss(animated: true, completion: nil)
              }))
  
              self.present(alert, animated: true, completion: nil)
          }
  
      }else
      {
          let alert = UIAlertController(title: "No Network Connection", message: "Connection Error Please Try Again", preferredStyle: UIAlertControllerStyle.alert)
  
          alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: { (action) in
              alert.dismiss(animated: true, completion: nil)
          }))
  
          self.present(alert, animated: true, completion: nil)
      }
  
  
  
  }
  </code></pre>