In my app I have a label which text came from the server so I don't Know its width, and at the end of this label directly there should be an UIImage.
My problem is: I don't know how to position the image because of the non static width of the label text.
To be more clear, this is a snapshot form the design and how should it be:
Any suggestion to solve this problem please?
UILabel
UILabel
with yourUILabel
.frame.widthSet the x coordinate of your UIImage
at yourUILabel.frame.width + emptySpace
like this
var yourUIImageView:UIImageView = UIImageView(frame: CGRectMake(x:PaddingFromLeft + yourUILabel.frame.width + emptySpace, y: yourYCoordinate, width: yourImageWidth, height : yourImageHeight))