SIAJSAJ IJSAIJSAJA SIAJSAJ IJSAIJSAJA - 9 months ago 31
Swift Question

Swift how to show only part of image?

I have got an image 300px300px, but i only want to show 100x100 of it, just like here https://www.pinterest.com/pin/31103053652400980/ background photo is only showing part of it.How can i do that?

Answer Source

You can use UIImageView that has property Clip To Bounds on. After that you can change Content Mode of the `UIImageView' that suits you.

Example:

enter image description here