I need place some UIView right after text ends with some conditions:
If there are enough space from text end to the right edge of container, place view right after. If there are no room - place view above. The problem is - it should work for second line as well.
I know there are API to get frame of formatted text in UILabel, which kind of work for single line. I also know about exclusion path, but it will work only if attached view will be aligned right, but i need it to be placed right after text ends.
Do you know API of TextKit or some trick to achieve this goal?
Possible way to solve this i though is to get the text range from second line and then calculate frame of UILabel for that single line, but i can not find is there are interface to do that.
The whole question is: How to get width (frame) of the text on the second line of UILabel/UITextView?