Thread with 3 posts
jump to expanded posttoday's progress on implementing UIKit and Core Animation in touchHLE: layer delegates/views can now draw stuff
https://github.com/hikari-no-yume/touchHLE/commit/f6775e74627578d0db5ab38de86c2bf55ca62073
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? ๐ค
well, here's what I did in the end, I just special-case UIView and check if those methods are overridden: https://github.com/hikari-no-yume/touchHLE/commit/9dcef6d8bd49debb62e18b66647ce19e94ad25a9
but I may have found a clue as to what Apple do: https://stackoverflow.com/a/9125946