Understanding UIGraphicsGetCurrentContext ()

I am trying to understand Quartz and understand the context on which you must build. If I have a function in which I create a context, but then I call another function for some other drawing in the same context, do I need to pass the context from the first method to the next? Or can I just use UIGraphicsGetCurrentContext()for any CG methods that need context, since I'm still painting in the same context?

+6
source share
1 answer

The docs for UIGraphicsGetCurrentContext () say:

nil. drawRect: , , . , UIView , UIGraphicsPushContext(_:) , UIGraphicsPushContext(_:).

UIGraphicsPushContext() UIGraphicsGetCurrentContext(). UIGraphicsGetCurrentContext() drawRect: UIGraphicsPushContext(), , , .

+14

All Articles