Currently I do something that looks a bit fuzzy because I am dealing with points with my UI Object but what I want to do is get the width and height of the UI Object (in my case a UIImageView) in pixels.
Is this possible? I have looked around the documentation but I have not seen anything that looks relevant.
Can anyone assist with this?
Thanks!
Have you tried this?
[object frame].size.height[object frame].size.widthI’m pretty sure that anything with a visual representation will have a frame attribute to indicate where it’s located. Of course, the
originof an object’s frame is relative to its container, but thesizeshould always be useable.Edit/Update:
I misread the initial question, which wants to also convert points –> pixels. Here’s how to make sure you get that correctly:
Then, multiply the height and width values by scale to get actual pixel count.