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

Random auto zoom-out issues #68

Open
sabiland opened this issue Nov 12, 2021 · 5 comments
Open

Random auto zoom-out issues #68

sabiland opened this issue Nov 12, 2021 · 5 comments

Comments

@sabiland
Copy link

sabiland commented Nov 12, 2021

I was testing ImageScrollView yesterday (latest Xcode and iPhone 11 with iOS 15) and there are some random issues with it. When zooming, panning, randomly auto zoom-out happens. It looks like some timer is firing and zooming-out to default zoom ?

@davuthdv
Copy link

Could this be the issue? #55

@sabiland
Copy link
Author

No, this cannot be the issue. I am using only portrait mode on iPhone and this happens. Or can this happen also if I have locked orientation?

@davuthdv
Copy link

Sorry, but I couldn't test for you right now. I did have my orientation locked and I did face that issue. I can't remember clearly. But I'm pretty sure that following the suggestion to comment out that line fixed the issue that I had.

@sabiland
Copy link
Author

sabiland commented Jan 26, 2022

Ok thx for info, I'll try it and comment it later. So commenting that line will stop updating view (as intended by library) on iPad rotations.

EDIT: Shit, I've just found out you cannot edit Swift Package code :)

@sabiland
Copy link
Author

sabiland commented Jun 24, 2022

Ok, I took source code version and fixed the issue.

@objc func changeOrientationNotification() {
        
        // SABI TWEAK
        if Helper.checkIPhone()
        {
            // Ignore ON IPHONE !!!
            return
        }
        else
        {
            // Take only valid orientations on iPad
            if UIDevice.current.orientation.isValidInterfaceOrientation
            {
                // On iPad ONLY if valid orientation !!!   
                // A weird bug that frames are not update right after orientation changed. Need delay a little bit with async.
                DispatchQueue.main.async {
                    self.configureImageForSize(self.imageSize)
                    self.imageScrollViewDelegate?.imageScrollViewDidChangeOrientation(imageScrollView: self)
                }
            }
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants