UIView
-
Generates 4 NSLayoutConstraints
Declaration
Swift
func makeAnchorConstraints(to superview: UIView) -> [NSLayoutConstraint]
Parameters
superview
The superview to which the view will stick
Return Value
[NSLayoutConstraint]: The 4 constraints in CSS Style order (Top, Right, Bottom, Left)
-
Adds Gesture helper views in the container view. Recommended when the whole view scrolls (
UIWebView
,MKMapView
,…)Declaration
Swift
func addCariocaGestureHelpers(_ edges: [UIRectEdge], width: CGFloat = 40.0)
Parameters
edges
An array of
UIRectEdge
on which to show the helperswidth
The width of the helper view. Recommended maximum value:
40.0
-
Safe way to get the insets of the view, depending on iOS version. On iOS 11.0 and higher, returns the safeAreaInsets
For < iOS 11.0, returns insets of StatusBar’s height, 0, 0, 0
Declaration
Swift
func insets() -> UIEdgeInsets
Return Value
UIEdgeInsets: The view’s insets