Added automatic copying of data to clipboard

This commit is contained in:
Alexander Munch-hansen 2017-08-01 14:39:45 +02:00
parent b56924322c
commit 548b560582

View File

@ -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()
}