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
|
||||
}
|
||||
|
||||
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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user