You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 8, 2023. It is now read-only.
RBLView and requiresConstraintBasedLayout default setting #44
I disagree with the default setting of returning YES from requiresConstraintBasedLayout.
The method layout is called only under auto layout on 10.7, whereas on 10.8 layout is called either because auto layout is enabled, or because the view is layer-backed. As a result, apps that need to use layout-based drawing code on 10.8 yet still don't want to use auto layout are left in a bind if they want to use RBLView.
If one single view touches any part of auto layout, the whole window will fall victim to the lag that auto layout can induce, especially on table views.
I would be fine with changing the default, since it was implemented before we ran into some of our own troubles with Auto Layout as well.
It'd be nice to have a consistent subview layout hook on 10.7 and 10.8, though. I've done this with -resizeSubviewsWithOldSize:, but that seems unlikely to work with views that do use Auto Layout.
At this point, the only thing that occurs to me is an overridable method named layoutSubviews, which is invoked from whichever layout hooks we might get (without OS conditionalizing).
That's sucky and confusing, though, and makes me think this responsibility should just lie on the user of the class.
Agree here, constraints cause a whole host of problems. Literally no existing code works with constraints layout enabled without some serious tweaking. I think either @jwilling's conditional or just diverting the layout responsibilities from RBLView to the subclass would be the best solutions.
@jwilling I wasn't disagreeing with changing the default return value of that method. I just think there's no way we can compensate for it elsewhere given the shitty layout APIs.
So, let's just remove any default layout code from RBLView.
Activity
jspahrsummers commentedon Oct 28, 2012
I would be fine with changing the default, since it was implemented before we ran into some of our own troubles with Auto Layout as well.
It'd be nice to have a consistent subview layout hook on 10.7 and 10.8, though. I've done this with
-resizeSubviewsWithOldSize:, but that seems unlikely to work with views that do use Auto Layout.jwilling commentedon Dec 9, 2012
Lets lay out what I think is happening here:
On OS X 10.8:
resizeSubviewsWithOldSize:is called without auto layoutresizeSubviewsWithOldSize:is not called with auto layoutlayoutis called without auto layoutlayoutis called with auto layoutOn OS X 10.7:
resizeSubviewsWithOldSize:is called without auto layoutresizeSubviewsWithOldSize:is not called with auto layoutlayoutis not called without auto layoutlayoutis called with auto layoutNot sure where to go from here. We could do an #ifdef and enable the
resizeSubviewsWithOldSize:code if we're on anything less than 10.7. Any ideas?jspahrsummers commentedon Dec 9, 2012
At this point, the only thing that occurs to me is an overridable method named
layoutSubviews, which is invoked from whichever layout hooks we might get (without OS conditionalizing).That's sucky and confusing, though, and makes me think this responsibility should just lie on the user of the class.
jwilling commentedon Dec 9, 2012
I'm just desperately thinking of ways we could get rid of the enabling of constraints as that causes no end of problems.
indragiek commentedon Dec 9, 2012
Agree here, constraints cause a whole host of problems. Literally no existing code works with constraints layout enabled without some serious tweaking. I think either @jwilling's conditional or just diverting the layout responsibilities from
RBLViewto the subclass would be the best solutions.jspahrsummers commentedon Dec 9, 2012
@jwilling I wasn't disagreeing with changing the default return value of that method. I just think there's no way we can compensate for it elsewhere given the shitty layout APIs.
So, let's just remove any default layout code from
RBLView.jwilling commentedon Dec 9, 2012
👍