ioscgcontextrefdrawingcontext

How to get know that CGContext is drawing to screen


I want to get know that current CGContext is used for image, PDF or for screen drawing. In Cocoa I just use [[NSGraphicsContext currentContext] isDrawingToScreen] ([NSGraphicsContext currentContextDrawingToScreen] on 10.10). How can I get the same information from CGContext?


Solution

  • Contrary to desktop, on iOS there's no direct drawing to screen as all views are layer backed. So your question probably is: How can I tell if the current context is used to fill the contents of a layer?

    I'm not aware of a public API that answers this.