Trying to make UIImageView scale when the scrollview is bouncing down.
The idea was stolen from this dribbble: https://dribbble.com/shots/3341878-Product-Page
As you can see, image is like'a scaling when the scrollview is bouncing down.
In my app I have the UIImageView inside the UIScrollview, I can't understand how to fix the top of the UIImageView while the UIScrolvview is bouncing down.
Here is what I want to do:
I recommend you to use one of the following libraries
MXParallaxHeader
StrechyParallaxScrollView
Apply a scale transform to your imageView based on your scrollview's offset. Something along those lines:
In this way you don't need to "fix" it to top, the imageView will simply scale up as the content offset decreases when bouncing. All you need is that your imageView has a top constraint (plus leading, trailing) and a height.
You can 'cheat' by placing the image above the scrollview and set its height in the didScroll method on you scrollviewdelegate (read content offset and determine image height). If you set the image to aspect fill it will have the effect you want.