I know how to find the size of text using sizeWithFont, but what I really want to do is find the actual highest point and lowest point of the text that was drawn in UILabel.
I need to add an artificial cursor to the view from UILabelinside it. The problem is that the text in UILabel, apparently, changes its upper and lower margins arbitrarily. I can’t understand how the OS works, where to place the text in UILabel.
So, it would be great to create a category or method that will process the original Y-axis pixel of the actual text drawn on the view.
Is this even possible? How does a UITextField correctly position text and cursor?
UPDATE
I thought it was possible by getting a UILabel context and finding a space at the top, which should give me the original Y value of the pixel of the actual text? I have no idea where to even start with this, or make it effective enough not to impede frequent changes to UILabel.
Many thanks.
source
share