Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer superview & return (constraints, views) #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BrianKenny
Copy link
Contributor

@BrianKenny BrianKenny commented May 18, 2017

This PS does 2 things. It lets regular view nodes opt into the inferred superview logic that's currently used for ghost views, in the case where they don't have a superview when constraints are created. This often gets rid of the need to ad subviews explicitly. Second, all the capture list operators go from returning just the constraints to returning a tuple of the constraints and the views. I've been converting all my spacerview code to mortarVFL, and almost every case we have something like

let theViews = [v1, v2, .........]
self.view |+| theViews
self.view |^^ v1 | v2 | .......
theViews.m_...

//Which now becomes something like

let theViews = (self.view |^^ v1 | v2 ........).views
theViews.m_....

It only saves 2 lines, but one of those is re-writing the array in a different form, which is tedious and error prone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants