alexhillc / AXPhotoViewer

An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.
https://www.cocoacontrols.com/controls/axphotoviewer
MIT License
642 stars 120 forks source link

Fix alexhillc/AXPhotoViewer#28 #58

Closed manmal closed 5 years ago

manmal commented 5 years ago

By assigning the new photoIndex to self.currentPhotoIndex, the following assertion and crash scenario is fixed:

  1. Host app creates an AXPhotosViewController and calls navigateToPhotoIndex(index, animated: false) on it, where index > 0
  2. Host app presents AXPhotosViewController
  3. User does not swipe left or right, but just dismisses the photo view
  4. Assertion "Unable to resolve some necessary properties in order to transition. [...]" fails, and on a non-debug build the app crashes.
alexhillc commented 5 years ago

Thanks for this fix! It will be in the next release.