Skip to content

View controller that shows an image within a UIScrollView, correctly centering the content when zooming out.

License

Notifications You must be signed in to change notification settings

PasiSalenius/ImageController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

ImageController

This controller demonstrates a modernized Swift version of Peter Steinberger's "contentInset setting" method of centering an UIImageView inside a UIScrollView. It seemed difficult to find a fully working version so I decided to make my own.

It otherwise uses auto layout but directly sets the frame of the UIImageView, as using contraints there proved problematic. It should correctly handle changes to the controller's size, such as device rotation.

I'm using ImageController in my Maptrails iOS map app for hiking and other outdoor activities. This controller is used as part of a paging controller to show a list of images attached to a map location.

Download on the App Store

References

About

View controller that shows an image within a UIScrollView, correctly centering the content when zooming out.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages