Finally I did it!
From my one-day experience, I learn that there are three ways to deal with this situation.
Just create your desired images as png files and just use UIImageView to display. (But remember, you must have the same image with different resolutions, which will increase the size of your application).
The second way: show bubbles (or possibly a rectangle) by creating labels, text fields, etc. with arrow. You can simply convert the image to reposition the arrow pointer. (As Ilker Baltachi said in the previous answer).
The third way is from Core Graphics. You can draw whatever you want. As far as I know, increasing the size of the application or increasing memory consumption by initializing / allocating / saving labels and text fields, we can try this with Core Graphics.
I have three views where I want to implement this help screen. For all three screens, I can use any of the three methods, because there is not much difference related to performance if we use it for little needed situations. But I tried with the third way, because, I really did not know anything about Core Graphics. So it’s easy to learn.
The problems I encountered :
The arrow should point to the center of the button (or possibly to the top of the button). Therefore, finding the exact location is difficult. I used this function on only 3 pages in my application. Each page contains a maximum of 4 icons for description. So I just encoded the values (another good luck, the application does not support landscape mode). But if you want to use this function for so many pages, you have to define some arrays and a method that finds the center of the icons, calculating its center with reference to their origin, height and width, blah, blah ..
Another problem is that you have to make sure that the bubbles do not cross anywhere. It also needs a global method that finds a location for each bubble. The size of the bubble depends on the size of the text that will be placed inside it. This is a more complex problem, and in just 3 screens I will not define a global method with hundreds of calculations. So again, I just encoded the starting point, the height and width of each bubble with reference to self.view
And last but not least. The Arrow !! The height of the arrow may vary depending on the location of the bubble. The width of the bubble can also vary in height. In addition, you should know the side and points of the bubble from which the arrow goes to the button. If you have already fixed the places of the bubbles in your mind, this is not a problem for you ..: P
Now let's get the coding part,
- (void) createRect:(CGRect)rect xPoint:(float)x yPoint:(float)y ofHeight:(float)height ofWidth:(float)width toPointX:(float)toX toPointY:(float)toY withString:(NSString *)helpString inDirection:(NSString *)direction { float distance = 5.0; float widthOfLine = 5.0; float arrowLength = 15.0;
You can call this method from the drawRect: method, like this.
[self createRect:rect xPoint:30.0 yPoint:250.0 ofHeight:100.0 ofWidth:100.0 toPointX:48.0 toPointY:430.0 withString:@"xxxxxxx" inDirection:@"left"]; [self createRect:rect xPoint:160.0 yPoint:100.0 ofHeight:100.0 ofWidth:100.0 toPointX:260.0 toPointY:420.0 withString:@"yyyyyyy" inDirection:@"right"];
And the final image will be like that.

I skipped the triangle shaped arrow because this type of arrow gives a handwriting effect.
Thanks to @djromero and Ilker Baltaci for your valuable answers.
My next perplexity is to draw texts !!!!!: P
source share