0

After retrieving an image from Parse and creating an UIImageView in the main storyboard, I did a screenshot of the view (DraggablePhoto) containing the UIImageView, by using the following scheme:

var view = MDCSwipeToChooseView(frame: self.DraggablePhoto.bounds, options: options)

    let imageori = UIGraphicsBeginImageContext(self.DraggablePhoto.bounds.size)
    let imageori1 = self.DraggablePhoto.layer.renderInContext(UIGraphicsGetCurrentContext()!)
    var screenShot = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()

    image = screenShot

    view.imageView.image = image

Problem is the UIImageView included in the DraggablePhoto view does not appear on the screenshot, knowing that the uiimageview includes a retrieved image from Parse...

My question is: Why is the screenshot not showing this image knowing that everything else is properly shown? How do you solve this problem? Please note I am a beginner.

EDIT: I found the solution to my problem. Just keep in mind that when you retrieve a file(i.e. picture) from Parse you need to make sure the screenshot function can access/be related with the line of code that matches the UIimageView with the image file... What I did is I called the screenshot func inside the .getDataInBackgroundWithBlock from Parse (not sure if this is a nice way to do it as I am still a beginner but it does the job on my screen)

DavidT.
  • 11
  • 1
  • 5
  • In what function is the above code located? – beyowulf Dec 10 '15 at 02:16
  • Here is question like yours http://stackoverflow.com/questions/25448879/how-to-take-full-screen-screenshot-in-swift – Pixele9 Dec 10 '15 at 02:17
  • in override func viewDidLoad() , and Pixele9 please note my UIImageView includes an image that is taken from Parse . Are you sure the replies to the other question are of any help? – DavidT. Dec 10 '15 at 02:29

0 Answers0