Save image to camera roll with UIImageWriteToSavedPhotosAlbum

前端 未结 1 469
醉酒成梦
醉酒成梦 2020-12-30 16:33

I am trying to save a photo with a button to camera roll after user capture a picture with Camera , but I don\'t know why my picture doesn\'t save at photo library !!

1条回答
  •  囚心锁ツ
    2020-12-30 17:16

    First make sure you are calling savePhoto. Then you can add an assertion to check that the image is not nil:

    - (IBAction) savePhoto {
        NSParameterAssert(img.image);
        UIImageWriteToSavedPhotosAlbum(img.image, nil, nil, nil);
    }
    

    0 讨论(0)
提交回复
热议问题