This is a pretty big, complicated question, so I will outline steps for you to follow to implement this. If you need help with a specific step, I suggest you post a separate, specific question.
Here we go:
When the "draw mode" button is tapped, add a view above the map
- Make sure this view takes all touch events so that the map does not scroll when the user draws
Subclass this view and override touchesBegan
and touchesMoved
to actually do the drawing. You can follow the tutorial here for that.
Keep an array of all vertices of the polygon in the view's coordinate system.
- On
touchesEnded
(when the user stops drawing), convert the points from above to map coordinates.
- Draw a polygon from the location coordinates.
- Remove that view you added in step 1 and turn off drawing mode.
If you need clarification about this process don't hesitate to ask.