UIView underlying rects for drawRect
UIView underlying rects for drawRect
- Subject: UIView underlying rects for drawRect
- From: Roland King <email@hidden>
- Date: Sat, 05 Dec 2015 11:02:45 +0800
NSView has a method getRectsBeingDrawn:count: which gives you the actual rects being drawn in a drawRect: call. Is there something equivalent for a UIView? Does UIView even do as I believe NSView does and only invalidate just the areas passed to setNeedsDisplayInRect:, meaning those are the only areas you actually need to redraw, or does it blow away the entire containing rectangle so you must repaint the entire area?
I have a time-series view which only invalidates a tiny sliver of view which changed and only draws that in drawRect:. However when the series gets long enough it trims the left hand end, so two tiny slivers of view are invalidated, one at each end, drawRect: coalesces them into one rect the entire size of the window and the whole series redraws on every iteration. I spotted this when I left the simulator running for an hour and the fans suddenly started spinning up.
I can work around it by overriding setNeedsDisplayInRect: and queuing up non-contiguous updates, releasing them only when drawRect has been called, but it would be nice not to have to. I suspect I’m SOL on this one.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden