Thread with 5 posts

jump to expanded post

but there's an inefficiency… an empty view that draws nothing will get a whole bitmap and corresponding CGBitmapContext allocated for it, because my UIView provides drawLayer:inContext: (which calls drawRect:). ideally I'd only do this if drawRect: isn't overridden, and I can only assume that's what Apple do. but how do they do that? there isn't a documented mechanism for this. does their CALayer have special knowledge of UIView? 🤔

Open thread at this post

@jrose oh yeah I don't mean there isn't a mechanism for checking — and if there wasn't, I could add one anyway, it's my runtime ;) — but rather that I don't know how I could make UIView, like, conditionally opt in to bitmap drawing… though I mean, conditionally responding to drawLayer:inContext: would theoretically be possible… oh god

Open thread at this post