olha
olha

Reputation: 2272

When is PHFetchResultChangeDetails's "hasMoves" equal to YES?

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?

Upvotes: 0

Views: 124

Answers (1)

olha
olha

Reputation: 2272

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;

Upvotes: 1

Related Questions