开发者

Is CGContextGetTextDrawingMode() a private API?

I'm using this sniplet to center strings that are drawn with CoreGraphics. I can't f开发者_StackOverflow中文版ind any documentation on the function CGContextGetTextDrawingMode(). It's obvious what it does, but is this a private API that I should avoid?


The test is simple: if it ain't documented, it's private. Don't use it for App Store submissions.

That said, the absence of this particular API seems like an oversight, since CGContextSetTextDrawingMode() is available and public. To stay on the safe side, if you know what mode you want, just set it and use it. If you want to preserve the existing value like in the snippet you point to, you can do this by saving and restoring the state of the graphics context using CGContextSaveGState, etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜