Skip to content

Commit 985b14d

Browse files
committed
minor updates
- FollowCenter operation - iOS 8.0 deployment target
1 parent 69e856e commit 985b14d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

LayoutOps/LayoutOps.xcodeproj/project.pbxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@
241241
DYLIB_INSTALL_NAME_BASE = "@rpath";
242242
INFOPLIST_FILE = LayoutOps/Info.plist;
243243
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
244+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
244245
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
245246
PRODUCT_BUNDLE_IDENTIFIER = org.psharanda.LayoutOps;
246247
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -259,6 +260,7 @@
259260
DYLIB_INSTALL_NAME_BASE = "@rpath";
260261
INFOPLIST_FILE = LayoutOps/Info.plist;
261262
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
263+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
262264
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
263265
PRODUCT_BUNDLE_IDENTIFIER = org.psharanda.LayoutOps;
264266
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -285,6 +287,7 @@
285287
1BAD4FF51CDF54CA00692E31 /* Release */,
286288
);
287289
defaultConfigurationIsVisible = 0;
290+
defaultConfigurationName = Release;
288291
};
289292
/* End XCConfigurationList section */
290293
};

LayoutOps/LayoutOps/LayoutOps.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
481482
public func SizeToFitMax(view: UIView?) -> LayoutOperation {
482483
return SizeToFit(view, width: .Max, height: .Max)
483484
}
484485

486+
// same as SizeToFit(view, width: .Current, height: .Current)
485487
public 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+
543549
public 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

Comments
 (0)