Random auto zoom-out issues
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 ?
Could this be the issue? #55
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?
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.
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 :)
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)
}
}
}
}