Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

RBLView and requiresConstraintBasedLayout default setting #44

Open

Description

@jwilling

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.

What can be done about this?

Activity

  1. jspahrsummers commented on Oct 28, 2012

    @jspahrsummers
    Contributor

    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.

  2. jwilling commented on Dec 9, 2012

    @jwilling
    ContributorAuthor

    Lets lay out what I think is happening here:

    On OS X 10.8:

    • resizeSubviewsWithOldSize: is called without auto layout
    • resizeSubviewsWithOldSize: is not called with auto layout
    • layout is called without auto layout
    • layout is called with auto layout

    On OS X 10.7:

    • resizeSubviewsWithOldSize: is called without auto layout
    • resizeSubviewsWithOldSize: is not called with auto layout
    • layout is not called without auto layout
    • layout is called with auto layout

    Not 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?

  3. jspahrsummers commented on Dec 9, 2012

    @jspahrsummers
    Contributor

    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.

  4. jwilling commented on Dec 9, 2012

    @jwilling
    ContributorAuthor

    I'm just desperately thinking of ways we could get rid of the enabling of constraints as that causes no end of problems.

  5. indragiek commented on Dec 9, 2012

    @indragiek
    Contributor

    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.

  6. jspahrsummers commented on Dec 9, 2012

    @jspahrsummers
    Contributor

    @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.

  7. jwilling commented on Dec 9, 2012

    @jwilling
    ContributorAuthor

    👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions