Skip to content

Infer superview & return (constraints, views) - #19

Open
BrianKenny wants to merge 1 commit into
jmfieldman:masterfrom
BrianKenny:master
Open

Infer superview & return (constraints, views)#19
BrianKenny wants to merge 1 commit into
jmfieldman:masterfrom
BrianKenny:master

Conversation

@BrianKenny

@BrianKenny BrianKenny commented May 18, 2017

Copy link
Copy Markdown
Contributor

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.

2 participants