yuriiik / isvimagescrollview Goto Github PK
View Code? Open in Web Editor NEWImage preview component with zoom, scroll and rotation support
License: MIT License
Image preview component with zoom, scroll and rotation support
License: MIT License
This is not a real issue so feel free to delete it.
I just wanted to say thanks.
I was having a really frustrating day trying to get this pinch/zoom/pan in a scrollview thing to work using constraints. I had it mostly working but there was always something weird with the content size or position, especially after rotating the screen. All the "tutorials" on how to do it were overly simplistic and didn't actually work very well.
I decided to try your code out and it worked perfectly. I adapted to work with any kind of UIView (as long as you pass an explicit aspect ratio) and it has worked great. Really saved my sanity!
Anyway, I tried looking you up on Twitter and I just saw that you're from Kiev. I hope you and your family are safe and are doing as well as you can, given the circumstances.
Take care dude and thanks again
I get the occasional crash:
[ISVImageScrollView scaleImageForScrollViewTransitionFromBounds:toBounds:]
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'
I think the line 101:
CGSize containedImageSizeOld = [self rectSizeForAspectRatio:self.imageAspectRatio
thatFitsSize:oldSize];
might be returning a zero size and further down the line, it becomes the denominator in a division.
I'm not sure if the fix should be done in 'rectSizeForAspectRatio:thatFitsSize:' or in 'scaleImageForScrollViewTransitionFromBounds'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.