0

Encountered a strange issue while trying to save a view. The picture saved crops out the image.

here is the code :

    let scale = UIScreen.mainScreen().scale

    let size:CGSize = CGSize(width: CGFloat(self.customView!.frame.size.width), height:  CGFloat(self.customView!.frame.size.height))


    UIGraphicsBeginImageContextWithOptions( size, false, scale);

    self.customView!.layer.renderInContext(UIGraphicsGetCurrentContext())
    let screenshot = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()

    UIImageWriteToSavedPhotosAlbum(screenshot, nil, nil, nil)

Please help! thanks in advance

flo bee
  • 830
  • 2
  • 11
  • 20

1 Answers1

0

The camera roll has an auto zoom since the height is a bit smaller than the screen.

Dan
  • 5,153
  • 4
  • 31
  • 42
flo bee
  • 830
  • 2
  • 11
  • 20