0

I'm writing my subclasses of PHChange along with PHFetchResultChangeDetails. I understand fields like insertedIndexes, insertedObjects, fetchResultBeforeChanges, fetchResultAfterChanges etc.

What I can't understand is a field hasMoves. Documentation says that it's "A Boolean value that indicates whether objects have been rearranged in the fetch result".

So my questions are:
1. What should the user do to reproduce the case when hasMoves = YES ?
2. If hasMoves = YES can the moves be calculated out of insertedIndexes\ changedIndexes \ removedIndexes, or don't I have access to the information about moves?

olha
  • 2,132
  • 1
  • 18
  • 39

1 Answers1

1

Well, it is possible to rearrange photos in the custom albums (but not the standard ones like CameraRoll, Favorites etc):

Open the album you want to organize. Hold your finger gently on the photo you want to move, then drag it to a different position. Release your finger to drop it into the new position.

Programmatically, PHAssetCollectionChangeRequest can be used:

- (void)replaceAssetsAtIndexes:(NSIndexSet *)indexes 
                withAssets:(id<NSFastEnumeration>)assets;
olha
  • 2,132
  • 1
  • 18
  • 39