I am developing an app where I want the UIImageview like instagram feed. I set the leading and trailing space to mainview as zero so width is now 100% of screen. Now how do i set the height so that it varies depending on image's scale. I tried setting content mode to Aspect Fit, but its not working and blank spaces are coming in the left and right side for a portrait mode image
How it came after selecting in UIIMageView
Aspect Fill
insteadAspect Fit
this will adjust image width without changing it's Aspect ratio. – Abdul Rehman