@@ -478,10 +478,12 @@ public func SizeToFit(view: UIView?, width: SizeToFitIntention, height: SizeToFi
478478 return SizeToFitOperation ( view: view, width: width, height: height)
479479}
480480
481+ // same as SizeToFit(view, width: .Max, height: .Max)
481482public func SizeToFitMax( view: UIView ? ) -> LayoutOperation {
482483 return SizeToFit ( view, width: . Max, height: . Max)
483484}
484485
486+ // same as SizeToFit(view, width: .Current, height: .Current)
485487public func SizeToFit( view: UIView ? ) -> LayoutOperation {
486488 return SizeToFit ( view, width: . Current, height: . Current)
487489}
@@ -540,6 +542,10 @@ public func Fill(view: UIView?, insets: UIEdgeInsets) -> LayoutOperation {
540542 ] )
541543}
542544
545+ public func Fill( view: UIView ? , inset: CGFloat ) -> LayoutOperation {
546+ return Fill ( view, insets: UIEdgeInsets ( top: inset, left: inset, bottom: inset, right: inset) )
547+ }
548+
543549public func Fill( view: UIView ? ) -> LayoutOperation {
544550 return Fill ( view, insets: UIEdgeInsetsZero)
545551}
@@ -814,3 +820,14 @@ public func Follow<T: Anchor>(anchor: T, withAnchor: T) -> LayoutOperation {
814820 return FollowOperation ( anchorToFollow: anchor, followerAnchor: withAnchor)
815821}
816822
823+ public func FollowCenter( ofView: UIView , dx dx1: CGFloat , dy dy1: CGFloat , withView: UIView , dx dx2: CGFloat , dy dy2: CGFloat ) -> LayoutOperation {
824+ return Combine ( [
825+ Follow ( HCenterAnchor ( ofView, inset: dx1) , withAnchor: HCenterAnchor ( withView, inset: dx2) ) ,
826+ Follow ( VCenterAnchor ( ofView, inset: dy1) , withAnchor: VCenterAnchor ( withView, inset: dy2) )
827+ ] )
828+ }
829+
830+ public func FollowCenter( ofView: UIView , withView: UIView ) -> LayoutOperation {
831+ return FollowCenter ( ofView, dx: 0 , dy: 0 , withView: withView, dx: 0 , dy: 0 )
832+ }
833+
0 commit comments