I'm trying to remove the top and bottom space of an image that is set to "aspect fit". I would think there is an easier way to just make an image adjust to the screen width and then adjust the height to whatever is scaled correctly like I do with anything on the web, but I guess there is not in xcode.
So now i'm trying to adjust the frame size after the aspect fit. I've been able to find the frame size and image size after going here: How to get the size of a scaled UIImage in UIImageView?
I can apply the new frame settings like this
//func from extension
let newSize = mainImage.frameForImageInImageViewAspectFit()
let newHeight = CGRectGetHeight(newSize)
let newWidth = CGRectGetWidth(newSize)
mainImage.frame.size.height = newHeight
mainImage.frame.size.width = newWidth
But i'm still at a loss where to apply those and all the labels are still aligned to the original imageview after I resize it. Is there an easier way to just get the layout in the bottom right?
Thanks for any help.