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

Photo disappears and flashes loading indicator when presented #60

Open bachonk opened 5 years ago

bachonk commented 5 years ago

To replicate

let photo = AXPhoto(attributedTitle: NSAttributedString(string: "Sent by \(comment.name)"),
                        attributedDescription: nil,
                        attributedCredit: nil,
                        url: URL(string: comment.attachmentURL!))

let transitionInfo = AXTransitionInfo(interactiveDismissalEnabled: true, startingView: cell.imageAttachmentView) { [] (photo, index) -> UIImageView? in
                // this closure can be used to adjust your UI before returning an `endingImageView`.
                cell.imageAttachmentView
}

let dataSource = AXPhotosDataSource(photos: [photo])
let photosViewController = AXPhotosViewController(dataSource: dataSource, pagingConfig: nil, transitionInfo: transitionInfo)
self.present(photosViewController, animated: true)

What happens Photo disappears and loading indicator shows briefly.

What should happen Initial photo should remain while the other photo is loading to prevent flashing screen.

flash

Rendel27 commented 5 years ago

Related to issue, but seems not solved yet :(