UIImageView Content Modes
![Oscar de la Hera Gomez](https://www.delasign.com/CDN/headshots/profile.webp)
![A flower that represents Swift next to a flower that represents XCode. Beneath it sits the text that states 'UIImageView Content Modes'.](https://www.delasign.com/CDN/images/UIImageView-Content-Modes.webp)
A guide to UIImageView content modes in Swift (iOS) and how they alter the image presented to a user.
The following tutorial makes use of the tutorial that we created for adding a UIImage to a UIView and is available on the tutorial/content-modes branch in the repository linked below.
How to alter content modes ?
Use the following line to alter your content mode, where your_content_mode is a UIImageView contentMode.
self.imageView.contentMode = .your_content_mode
What are the popular content modes?
Scale Aspect Fit
Available using .scaleAspectFit.
![Sample screenshot of the scale aspect fit content mode.](https://www.delasign.com/CDN/images/scaleAspectFit1920x1080.webp)
Scale Aspect Fill
Available using .scaleAspectFill.
![Sample screenshot of the Scale Aspect Fill content mode.](https://www.delasign.com/CDN/images/scaleAspectFill1920x1080.webp)
Scale To Fill
Available using .scaleToFill.
![A screenshot of the scale to fill content mode.](https://www.delasign.com/CDN/images/scaleToFill1920x1080.webp)
What other modes are available?
Top
Available using .top.
![A screenshot of the top content mode.](https://www.delasign.com/CDN/images/top1920x1080.webp)
Right
Available using .right.
![A screenshot of the right content mode.](https://www.delasign.com/CDN/images/right1920x1080.webp)
Center
Available using .center.
![A screenshot of the center content mode.](https://www.delasign.com/CDN/images/center1920x1080.webp)
Bottom
Available using .bottom.
![A screenshot of the bottom content mode.](https://www.delasign.com/CDN/images/bottom1920x1080.webp)
Left
Available using .left.
![A screenshot of the left content mode.](https://www.delasign.com/CDN/images/left1920x1080.webp)
Redraw
Available using .redraw.
![A screenshot of the redraw content mode.](https://www.delasign.com/CDN/images/redraw1920x1080.webp)
Bottom Left
Available using .bottomLeft.
![A screenshot of the bottom left content mode.](https://www.delasign.com/CDN/images/bottomLeft1920x1080.webp)
Bottom Right
Available using .bottomRight.
![A screenshot of the bottom right content mode.](https://www.delasign.com/CDN/images/bottomRight1920x1080.webp)
Top Left
Available using .topLeft.
![A screenshot of the top left content mode.](https://www.delasign.com/CDN/images/topLeft1920x1080.webp)
Top Right
Available using .topRight.
![A screenshot of the top right content mode.](https://www.delasign.com/CDN/images/topRight1920x1080.webp)
Any Questions
We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.