func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
var x = CGFloat(arc4random_uniform(100)+50)
var y = CGFloat(arc4random_uniform(100)+50)
var image = info[UIImagePickerControllerOriginalImage] as UIImage // create a variable from the image
var imageViewNew = UIImageView(frame: CGRectMake(100, 100, 150 , 150)) // creating a new UIImageView for the image once loaded on the screen
imageViewNew.center = CGPoint(x: x, y: y)
imageViewNew.image = image
imageView.addSubview(imageViewNew) // add the newly created UIImageView to the main Imageview Subview
imageViewNew.multipleTouchEnabled = true
imageViewNew.userInteractionEnabled = true // UIImageView by default has these disabled
createPanGestureRecognizer(imageViewNew)
createPinchGestureRecognizer(imageViewNew) // adding gesture to the newly created image ? Keep in mind you have to create these functions separately.
createRotateGestureRecognizer(imageViewNew)
dismissViewControllerAnimated(true, completion: nil)
}