CGGetcurrentContext in UIview

1

I do not understand where the method mentioned in the title comes from, nor the other classes with the prefix 'CG', of core graphics. I searched for the framework 'Core Graphics' but it does not appear in UIKIT or in Cocoa touch.

One more thing, what would be a context? I read it in the api but I did not understand it.

    
asked by MatiEzelQ 26.03.2016 в 19:48
source

1 answer

1

CGGetCurrentContext is the call sign for the context in CoreGraphics.

let miContexto = UIGraphicsGetCurrentContext()
CGContextSaveGState(miContexto);

Context can be defined as a reference that the Operating System needs to know where information is being stored, for example, in which UIImageView you have an image stored.

This definition seems right to CG:

  

The context tells each CG call where to find all these "things"   of his current "Drawing" call, gives a different context for it   drawing call, and that call could draw a bitmap   different in a completely different view, with one color   different, different scale, etc.

definition taken from:

link (English)

    
answered by 26.03.2016 в 21:19