UIView.pin.safeArea / safeAreaInsetsDidChange() / margins percentage methods
Released on 2018-03-22
UIView.pin.safeArea
PinLayout can handle easily iOS 11 UIView.safeAreaInsets, but it goes further by supporting safeAreaInsets for previous iOS releases (including iOS 7/8/9/10) by adding a property UIView.pin.safeArea. PinLayout also extend the support of UIView.safeAreaInsetsDidChange() callback on iOS 7/8/9/10.
See UIView.pin.safeArea Documentation for more details.
Added by Luc Dion in Pull Request #125
Add methods taking UIEdgeInset as parameter
-
all(_ insets: UIEdgeInsets) -
horizontally(_ insets: UIEdgeInsets) -
vertically(_ insets: UIEdgeInsets) -
top(_ insets: UIEdgeInsets) -
bottom(_ insets: UIEdgeInsets) -
left(_ insets: UIEdgeInsets) -
right(_ insets: UIEdgeInsets)See Layout using distances from superview’s edges for more details.
Add margins method with percentage parameter
-
marginTop(_ percent: Percent) -
marginLeft(_ percent: Percent) -
marginBottom(_ percent: Percent) -
marginLeft(_ percent: Percent) -
marginStart(_ percent: Percent) -
marginEnd(_ percent: Percent) -
marginHorizontal(_ percent: Percent) -
marginVertical(_ percent: Percent) -
margin(_ percent: Percent) -
margin(_ vertical: Percent, _ horizontal: Percent) -
margin(_ top: Percent, _ horizontal: Percent, _ bottom: Percent) -
margin(_ top: Percent, _ left: Percent, _ bottom: Percent, _ right: Percent)