iosphoto

Does the Photos access API in iPhone allow removal of photos from an application?


Our development team is planning a product, and we need to figure out if it's possible to remove photos from Photos library on iOS via our application code. We are basically doing a backup and clean application. Please let me know if this is possible via API's provided by Apple.


Solution

  • You can do it via Photos.Framework , but it's only available later versions iOS 8.

    Sample code is available at developer's library.

        // Delete asset from library
        [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
            [PHAssetChangeRequest deleteAssets:@[self.asset]];
        } completionHandler:completionHandler];