Added dispatch.async.. Should update text field.
This commit is contained in:
parent
dc7848120c
commit
898cb3f65b
|
@ -47,6 +47,11 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP
|
||||||
imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
|
imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setTextInField(path: String) {
|
||||||
|
dcavTextField.text = path
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@IBAction func onSaveButton(_ sender: Any) {
|
@IBAction func onSaveButton(_ sender: Any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,8 +81,9 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP
|
||||||
}
|
}
|
||||||
self.responseString = String(data: data, encoding: .utf8)!
|
self.responseString = String(data: data, encoding: .utf8)!
|
||||||
print("responseString = \(String(describing: self.responseString))")
|
print("responseString = \(String(describing: self.responseString))")
|
||||||
|
DispatchQueue.main.async() {
|
||||||
self.dcavTextField.text = "https://dcav.pw/\(String(describing: self.labell.text![(self.labell.text!.startIndex)]))\(String(describing: self.responseString!))"
|
self.setTextInField(path: "https://dcav.pw/\(String(describing: self.labell.text![(self.labell.text!.startIndex)]))\(String(describing: self.responseString!))")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task.resume()
|
task.resume()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user