I am trying to draw a sequence of pattern images (different repeating patterns in one view).
So, I did this in a loop:
CGContextRef context = UIGraphicsGetCurrentContext();
I think that after I cut the context to draw a pattern in a specific rectangle, I cut a fragment from a large canvas, and the next time my canvas disappeared. cannot cut another fragment. So, should I reset something to crop so that I can draw another drawing again somewhere else?
Edit: in the documentation, I found this:
CGContextClip: "... Therefore, to recolor the restoration area of ββthe cropping path to a state, you must save the graphics before the clip and restore the state of the graphic after you have completed any cropped drawing ...."
So, how to save the state of the graphics before cropping and how to restore it?
source share