Q:

How to present UIImagePickerController from UIImageView with Tap Gesture

I want the view to load with a default image and let the user tap this image to select another from the photo library. I'm doing this way, but the tap gesture is not working, what am I doing wrong?
class ProfileViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate {

    let imagePicker = UIImagePickerController()
    @IBOutlet var profilePicture: UIImageView!

    override func viewDidLoad() {
        super.viewDidLoad()

        let tap = UITapGestureRecognizer(target: self, action: Selector("selectProfilePicture"))
        profilePicture.addGestureRecognizer(tap)

        imagePicker.delegate = self
    }

    func selectProfilePicture() {

        imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
        imagePicker.allowsEditing = false
        self.presentViewController(imagePicker, animated: true, completion: nil)

    }

    func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) {

        self.dismissViewControllerAnimated(true, completion: nil)
        profilePicture.image = image

    }
}

A:

Try to enable userInteractionEnabled on your UIImageView:
profilePicture.userInteractionEnabled = true

