Save image in UIImageView to iPad Photos Library

前端 未结 4 1183
死守一世寂寞
死守一世寂寞 2020-12-31 22:40

I am creating an iPad app that has several pictures (UIImageViews) in a horizontal scrollview. I want to allow the user to be able to save the images to their P

4条回答
  •  长发绾君心
    2020-12-31 23:27

    You can use the image property of a UIImageView to get the current image:

    UIImage* imageToSave = [imageView image]; // alternatively, imageView.image
    
    // Save it to the camera roll / saved photo album
    UIImageWriteToSavedPhotosAlbum(imageToSave, nil, nil, nil);
    

提交回复
热议问题