0

Is it possible to insert a new PHAsset to an appointed index in the camera roll?

I tried following:

let cam_req = PHAssetCollectionChangeRequest(for: camera_roll)
cam_req?.insertAssets([asset] as NSArray, at: IndexSet(integer: pos))

doesn't work.

Anshul Bhatheja
  • 673
  • 3
  • 21
al_lea
  • 596
  • 1
  • 9
  • 17

2 Answers2

1

The Camera Roll is like a stack. It's sorted by import date. There is no way to change the order or to insert a photo/video at a specific position. If you want to do that you have to create a custom user album. Custom user albums contain references to the originals in the Camera Roll and can be reordered.

holtmann
  • 6,043
  • 32
  • 44
0

http://www.tapsmart.com/tips-and-tricks/album-order-reordering-photos-album-ios-12-guide/

It’s important to note that this only works for custom photo albums you’ve created yourself – default albums like “All Photos” and “Favorites” are arranged chronologically and can’t be rearranged this way.

then it's impossible to change the order of “All Photos” and “Favorites” manually - on API level should also be limited.

al_lea
  • 596
  • 1
  • 9
  • 17