core graphics - iOS - Can UIGraphicsGetCurrentContext be used outside drawRect? -


i want dynamically change current cgcontextref according different user actions? possible or modification possible within drawrect: of view instance? happens when call uigraphicsgetcurrentcontext() outside drawrect: , there limitations in doing so, recommended? possible implications need consider?

according docs graphics context set before function called. means if function not called won't set , if don't make system call again (never reason) won't there either.

use 1 of these functions force view drawrect:

setneedsdisplay: setneedsdisplayinrect: 

it doesn't mean can stuff inside drawrect however. context sort of globally available @ moment , can call clean separate functions or classes drawing things. passing reference functions clean way it.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -