Photo library's image is not shown. My app is like my app
My goal in this app is 2 points.First thing is when I put "PhotoSelect" button,I can select photo library's image.Second thing is to be shown the library's image in UIImageView but this cannot be done.I can access photo library, select picture but the picture is not shown. PhotoController is
import Foundation
import UIKit
class PhotoController:UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelegate{
@IBOutlet weak var myImageView: UIImageView!
@IBAction func PhotoSelect(_ sender: Any) {
let myPickerController = UIImagePickerController()
myPickerController.delegate = self;
myPickerController.sourceType = UIImagePickerControllerSourceType.photoLibrary
self.present(myPickerController, animated: true, completion: nil)
}
@IBAction func PhotoSend(_ sender: Any) {
}
private func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject])
{
myImageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
self.dismiss(animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
//myImageUploadRequest()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
I think connection is ok, so necessary code is not in PhotoController,right?But I do not know the code to add this PhotoController.How can fix this?