Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fullscreen initial image bug when slideshow is not circular #67

Closed
ghost opened this issue Sep 29, 2016 · 6 comments
Closed

Fullscreen initial image bug when slideshow is not circular #67

ghost opened this issue Sep 29, 2016 · 6 comments
Labels
Projects

Comments

@ghost
Copy link

ghost commented Sep 29, 2016

When I have multiple images in my slideshow and set slideshow.circular = false, then click on an image to present in full screen would not present the current image I tapped. It would actually load the previous image! So I guess the index of the initial image is not set properly when the full screen is presented.

Forget to mention I'm using the swift-3 branch :)

@zvonicek
Copy link
Owner

zvonicek commented Oct 3, 2016

Hi, thanks for your report! I'll look into that.

@zvonicek zvonicek added the bug label Oct 3, 2016
@adamfraser
Copy link

Getting this same issue on version 0.6

@adamfraser
Copy link

adamfraser commented Oct 11, 2016

I can fix this by setting 'circular' to false on the FullScreenSlideshowViewController's 'slideshow' property.

eg using the example from the Readme:
ctr.slideshow.circular = false

Maybe setting circular to false on an ImageSlideshow instance should do the same for a FullScreenSlideshowViewController? At the moment they don't really know about each other so might take some refactoring (could be paired with #72). I can also see users wanting to have circular enabled on one and not in the other.

@zvonicek
Copy link
Owner

The problem was caused by using scrollViewPage in FullScreenSlideshowVC, which is not consistent if one slideshow is circular and other is not. I fixed it by changing that to currentPage, which preserves such consistency.

This change however breaks backward compatibility so I cannot push it straight away to swift-3 branch, which is currently used by some users but not CocoaPods-versioned. It's therefore just in swift-3-dev for now and will be part of 1.0 release that's hopefully comming soon.

@ghost
Copy link
Author

ghost commented Oct 21, 2016

Just checked the swift-3-dev. It fixed the previous bug yet introduced another new one.

FullScreenSlideshowVC now opens at the same index as the current imageSlide. But when FullScreenSlideshowVC dismiss, the imageSlide slide current index is one behind the correct index.

@zvonicek
Copy link
Owner

Note that you also need to change your pageSelected closure and call setCurrentPage instead of setScrollViewPage. Check my change in sample project in 9e88e08.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
v1.0
Done
Development

No branches or pull requests

2 participants