bhlvoong / LBTATools

Set of tools to drastically improve development speed of UI in iOS applications
MIT License
727 stars 94 forks source link

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

Open zakbarlow1995 opened 4 years ago

zakbarlow1995 commented 4 years ago

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.