How can I get the height and width of an uiimage? How can I get the height and width of an uiimage? ios ios

How can I get the height and width of an uiimage?


let heightInPoints = image.size.heightlet heightInPixels = heightInPoints * image.scalelet widthInPoints = image.size.widthlet widthInPixels = widthInPoints * image.scale


Use the size property on the UIImage instance. See the documentation for more details.


UIImage *img = [UIImage imageNamed:@"logo.png"];CGFloat width = img.size.width;CGFloat height = img.size.height;