This is heavily related to my question here: Is there a way to get a high-res YouTube video thumbnail without letter-boxing?
Say I always get images back from an API that need to be cropped. They always have black letter-boxing at the top and bottom.
Now I could programmatically crop every UIImage down to the size it should be, but actually altering the image seems like a very expensive operation, and a waste when I really just need to hide it.
How would I best go about putting it in a UIImageView
and making sure that the black bars aren't visible? To make it easier, it's safe to assume that it will be cropped into an aspect ratio that is the same as what the image is without the black bars (so in the above example, 16:9).