Eytan Levit
Eytan Levit

Reputation: 473

iOS8 PhotoKit: when does [asset canPerformEditOperation:PHAssetEditOperationDelete] return false?

It turns out not all assets can be deleted using iOS 8's new PhotoKit SDK, and you can test each asset for being deletable by calling [asset canPerformEditOperation:PHAssetEditOperationDelete].

What's the criteria that makes an asset undeletable? I've tried to make photos undeletable by making them hidden, burst or by editing them on multiple iPhone devices with iOS8 with no success.

Thanks

Upvotes: 4

Views: 699

Answers (1)

Josh Heald
Josh Heald

Reputation: 3947

On iOS, you cannot delete photos which have been synced from a computer using iTunes.

For a user, the only way to remove these photos from the device is by unsyncing those folders/albums within iTunes. If you view a synced photo in the iOS 8 Photos app, you'll see that the trashcan button usually available in the bottom right, is not there.

I'm not absolutely sure that this is the only reason why an asset may not be deleted, but it's the only one I've found in my photo library and looking around the web. Unfortunately, as you'll have seen, the reasons for this flag being set aren't documented by Apple anywhere, however this support item details the ways a user may delete photos from their device:

To delete synced photos and videos from your device

  • In iTunes, click the Device button in the upper right corner. (If viewing the iTunes Store, click the Library button in the upper-right corner first.)
  • Click the Photos tab in the resulting window.
  • Choose "Selected albums" and deselect the albums or collections you want to delete.
  • Note: To delete all synced photos, deselect "Sync Photos from" and, when asked, click "Remove photos."
  • Click Apply.

To delete Camera Roll photos and videos from your device

There are two methods to delete items from the Camera Roll:

  1. Import the Camera Roll to your computer and choose to delete items after import.
  2. Delete photos and videos from your device manually:

    • Open the Photos application and open the Camera Roll.
    • Tap the Action button.
    • Tap each photo to select it.
    • Tap the Delete button.

The fact that an on device method is specified for Camera Roll photos but not for synced photos is the strongest evidence I can find from Apple (there are a multitude of how-to guides on other sites) that you can't delete synced photo on an iOS device.

Upvotes: 4

Related Questions