Skip to content

Add constrainSize method + replace !=0 with >0 checks in UIView+Layout.swift#36

Open
zakbarlow1995 wants to merge 5 commits intobhlvoong:masterfrom
zakbarlow1995:feature/constrain-size
Open

Add constrainSize method + replace !=0 with >0 checks in UIView+Layout.swift#36
zakbarlow1995 wants to merge 5 commits intobhlvoong:masterfrom
zakbarlow1995:feature/constrain-size

Conversation

@zakbarlow1995
Copy link
Copy Markdown
Contributor

Added constrainSize(_ size: CGSize) -> AnchoredConstraints method, replaced old !=0 checks with >0 for width/height constraints (matching new variadic anchor method) & removed moot translatesAutoresizingMaskIntoConstraints = false setting in fillSuperview(SafeAreaLayoutGuide) methods (as following anchor call does this). Also removed unused let anchoredConstraints = AnchoredConstraints() declaration in fillSuperview(SafeAreaLayoutGuide) methods.

Tweaks to constrainWidth/Height ensure that an invalid constant (i.e. one that is ≤0) does not alter view.

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.

1 participant