I have created an image for textfield in my iOS app. But the text seems to overlap the image. Is there any way to prevent this or achieve the same design in another way. Below is the image of the problem I'm facing.
Is there any way to make the text start from a particular position in the text field?
Best How To :
One solution is to make your UITextField a subclass of UITextField. This will allow you to override
textRectForBounds: - and now you are in charge of where the text will go.
In particular, in your override, call
super to get the original rect. Now increase the x-component of the origin by some amount to allow room for your image, and decrease the width of the size by that same amount. Return the resulting modified rect and you're done.