diff --git a/dcav-uploader/ViewController.swift b/dcav-uploader/ViewController.swift index 70072ce..a26db80 100644 --- a/dcav-uploader/ViewController.swift +++ b/dcav-uploader/ViewController.swift @@ -17,6 +17,7 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP var responseString : String! @IBOutlet weak var uploadProgressBar: UIProgressView! @IBOutlet weak var savedPhotoImageView: UIImageView! + let pasteBoard = UIPasteboard.general override func viewDidLoad() { super.viewDidLoad() @@ -46,6 +47,7 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { imagePickerController.dismiss(animated: true, completion: nil) + imageView.contentMode = .scaleAspectFit imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage } @@ -82,10 +84,10 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP self.responseString = String(data: data, encoding: .utf8)! print("responseString = \(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!))") + self.setTextInField(path: "https://dcav.pw/\(String(describing: self.labell.text![(self.labell.text!.startIndex)]))\(String(describing: self.responseString!))") + self.pasteBoard.string = self.dcavTextField.text! } } - task.resume() }