diff --git a/dcav-uploader/ViewController.swift b/dcav-uploader/ViewController.swift index 981fafd..9f767d2 100644 --- a/dcav-uploader/ViewController.swift +++ b/dcav-uploader/ViewController.swift @@ -46,7 +46,12 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP imagePickerController.dismiss(animated: true, completion: nil) imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage } - + + func setTextInField(path: String) { + dcavTextField.text = path + } + + @IBAction func onSaveButton(_ sender: Any) { } @@ -76,8 +81,9 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP } self.responseString = String(data: data, encoding: .utf8)! print("responseString = \(String(describing: self.responseString))") - - self.dcavTextField.text = "https://dcav.pw/\(String(describing: self.labell.text![(self.labell.text!.startIndex)]))\(String(describing: self.responseString!))" + DispatchQueue.main.async() { + self.setTextInField(path: "https://dcav.pw/\(String(describing: self.labell.text![(self.labell.text!.startIndex)]))\(String(describing: self.responseString!))") + } } task.resume()