NYTPhotoViewer
NYTPhotoViewer copied to clipboard
Lag and delay
Abstract
Loading and using the photo viewer lib is subject to incredible amounts of lag and delay.
Steps to reproduce
- Load images asynchronously into a collection view controller as thumbnails
- Select a thumbnail
- Instantiate
NYTPhotosViewController
with validNYTPhoto
instances (3 in this case) - Present the VC
Observed results
There is a 2-4 second delay between the time I select an image thumbnail in my collection view until the view controller is presented.
Additionally, while swiping between images, there is a significant 3-4 second delay.
Expected results
The view controller is presented immediately.
Swiping thru photos is seamless and smooth, incurs no delay.
Detail & Methodology
Project setup
- Using Carthage for this dependency
- Workspace: 2 iOS apps, 1 framework, Cocoapods project
Workflow
All images are downloaded asynchronously and stored in a view model (MVVM) before presentation to the user.
The images are already in existence as UIImage
instances before NYTPhotosViewController
is presented.
Data
Three images in question that cause this library to perform extremely poorly have the following byte sizes (as returned by HTTP Content-Length
field):
- 1667272
- 2567293
- 247022
I do not feel these are unreasonable sizes for the images.
Attempted workarounds
- Using the latest release tag instead of the readme's given
Cartfile
entry - Storing a strong reference to
NYTPhotosViewController
on presenting view controller (aka reusing, not re-instantiating each time a thumbnail is tapped)
This lag makes this library unusable!
Can provide photos, videos upon request. Please advise, thank you.
👍 Seeing and experiencing these same delays. Something seems off - shouldn't be this slow.
@ArtisOracle does your instance of NYTPhoto
implement imageData
property? In my case returning nil
from this property helped.
Please look at imageData
property documentation in the NYTPhoto
protocol for more details.
+1
Hi,
I have the same problem. Is there any solution? I have a delay of 2 or 4 seconds when I tap of a thumbnail.