diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..c544cb6 --- /dev/null +++ b/Podfile @@ -0,0 +1,10 @@ +# Uncomment the next line to define a global platform for your project +# platform :ios, '9.0' + +target 'YTAnimationDemo' do + # Comment the next line if you don't want to use dynamic frameworks + use_frameworks! + + pod 'SnapKit' + +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..11c823d --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,16 @@ +PODS: + - SnapKit (4.2.0) + +DEPENDENCIES: + - SnapKit + +SPEC REPOS: + trunk: + - SnapKit + +SPEC CHECKSUMS: + SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a + +PODFILE CHECKSUM: 75d2635015507fcf083ab37aaa0fcaa9729ea08b + +COCOAPODS: 1.10.0 diff --git a/YTAnimationDemo.xcodeproj/project.pbxproj b/YTAnimationDemo.xcodeproj/project.pbxproj index cba1190..31f4bb3 100644 --- a/YTAnimationDemo.xcodeproj/project.pbxproj +++ b/YTAnimationDemo.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 8769614394667A1BE32A4C14 /* Pods_YTAnimationDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AECA41A0EABFA0962FB7BBD /* Pods_YTAnimationDemo.framework */; }; 9D5D73D820BB995C0065456B /* YTTransitionAnimationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D5D73D720BB995C0065456B /* YTTransitionAnimationViewController.swift */; }; 9D5D73DA20BBD8A20065456B /* YTCombinationAnimationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D5D73D920BBD8A20065456B /* YTCombinationAnimationViewController.swift */; }; 9D5D73E920BE36390065456B /* DCPathButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D5D73E020BE36390065456B /* DCPathButton.m */; }; @@ -24,36 +25,6 @@ 9D6E7DDD20B69B40007EB132 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9D6E7DDB20B69B40007EB132 /* Main.storyboard */; }; 9D6E7DDF20B69B42007EB132 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9D6E7DDE20B69B42007EB132 /* Assets.xcassets */; }; 9D6E7DE220B69B42007EB132 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9D6E7DE020B69B42007EB132 /* LaunchScreen.storyboard */; }; - 9D6E7E1B20B6A00F007EB132 /* ConstraintMultiplierTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7DF820B6A00F007EB132 /* ConstraintMultiplierTarget.swift */; }; - 9D6E7E1D20B6A00F007EB132 /* ConstraintDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7DFA20B6A00F007EB132 /* ConstraintDescription.swift */; }; - 9D6E7E1E20B6A00F007EB132 /* ConstraintMakerPriortizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7DFB20B6A00F007EB132 /* ConstraintMakerPriortizable.swift */; }; - 9D6E7E1F20B6A00F007EB132 /* ConstraintAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7DFC20B6A00F007EB132 /* ConstraintAttributes.swift */; }; - 9D6E7E2020B6A00F007EB132 /* ConstraintViewDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7DFD20B6A00F007EB132 /* ConstraintViewDSL.swift */; }; - 9D6E7E2120B6A00F007EB132 /* ConstraintPriorityTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7DFE20B6A00F007EB132 /* ConstraintPriorityTarget.swift */; }; - 9D6E7E2220B6A00F007EB132 /* ConstraintInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7DFF20B6A00F007EB132 /* ConstraintInsets.swift */; }; - 9D6E7E2320B6A00F007EB132 /* ConstraintMakerFinalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0020B6A00F007EB132 /* ConstraintMakerFinalizable.swift */; }; - 9D6E7E2420B6A00F007EB132 /* ConstraintDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0120B6A00F007EB132 /* ConstraintDSL.swift */; }; - 9D6E7E2520B6A00F007EB132 /* ConstraintMakerExtendable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0220B6A00F007EB132 /* ConstraintMakerExtendable.swift */; }; - 9D6E7E2720B6A00F007EB132 /* ConstraintInsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0420B6A00F007EB132 /* ConstraintInsetTarget.swift */; }; - 9D6E7E2820B6A00F007EB132 /* ConstraintConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0620B6A00F007EB132 /* ConstraintConfig.swift */; }; - 9D6E7E2920B6A00F007EB132 /* UILayoutSupport+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0720B6A00F007EB132 /* UILayoutSupport+Extensions.swift */; }; - 9D6E7E2A20B6A00F007EB132 /* ConstraintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0820B6A00F007EB132 /* ConstraintView.swift */; }; - 9D6E7E2B20B6A00F007EB132 /* ConstraintLayoutGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0920B6A00F007EB132 /* ConstraintLayoutGuide.swift */; }; - 9D6E7E2C20B6A00F007EB132 /* ConstraintLayoutSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0A20B6A00F007EB132 /* ConstraintLayoutSupport.swift */; }; - 9D6E7E2D20B6A00F007EB132 /* ConstraintConstantTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0B20B6A00F007EB132 /* ConstraintConstantTarget.swift */; }; - 9D6E7E2E20B6A00F007EB132 /* ConstraintOffsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0C20B6A00F007EB132 /* ConstraintOffsetTarget.swift */; }; - 9D6E7E2F20B6A00F007EB132 /* ConstraintMakerEditable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0D20B6A00F007EB132 /* ConstraintMakerEditable.swift */; }; - 9D6E7E3020B6A00F007EB132 /* ConstraintMaker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0E20B6A00F007EB132 /* ConstraintMaker.swift */; }; - 9D6E7E3120B6A00F007EB132 /* ConstraintRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E0F20B6A00F007EB132 /* ConstraintRelation.swift */; }; - 9D6E7E3220B6A00F007EB132 /* ConstraintLayoutGuideDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E1020B6A00F007EB132 /* ConstraintLayoutGuideDSL.swift */; }; - 9D6E7E3320B6A00F007EB132 /* ConstraintView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E1120B6A00F007EB132 /* ConstraintView+Extensions.swift */; }; - 9D6E7E3420B6A00F007EB132 /* ConstraintItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E1220B6A00F007EB132 /* ConstraintItem.swift */; }; - 9D6E7E3520B6A00F007EB132 /* Constraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E1320B6A00F007EB132 /* Constraint.swift */; }; - 9D6E7E3620B6A00F007EB132 /* Debugging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E1420B6A00F007EB132 /* Debugging.swift */; }; - 9D6E7E3720B6A00F007EB132 /* ConstraintRelatableTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E1520B6A00F007EB132 /* ConstraintRelatableTarget.swift */; }; - 9D6E7E3920B6A00F007EB132 /* LayoutConstraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E1720B6A00F007EB132 /* LayoutConstraint.swift */; }; - 9D6E7E3B20B6A00F007EB132 /* ConstraintLayoutSupportDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E1920B6A00F007EB132 /* ConstraintLayoutSupportDSL.swift */; }; - 9D6E7E3C20B6A00F007EB132 /* ConstraintMakerRelatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E1A20B6A00F007EB132 /* ConstraintMakerRelatable.swift */; }; 9D6E7E3F20B6A073007EB132 /* BaseConst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E3E20B6A073007EB132 /* BaseConst.swift */; }; 9D6E7E5220B79E87007EB132 /* YTBaseAnimationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E5120B79E87007EB132 /* YTBaseAnimationViewController.swift */; }; 9D6E7E5420B7A1B9007EB132 /* YTBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D6E7E5320B7A1B9007EB132 /* YTBaseViewController.swift */; }; @@ -75,6 +46,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 05AD958427B099DEEE6212AB /* Pods-YTAnimationDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YTAnimationDemo.release.xcconfig"; path = "Target Support Files/Pods-YTAnimationDemo/Pods-YTAnimationDemo.release.xcconfig"; sourceTree = ""; }; + 0AECA41A0EABFA0962FB7BBD /* Pods_YTAnimationDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YTAnimationDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3CCB4CF8CA0CB52E8344576D /* Pods-YTAnimationDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YTAnimationDemo.debug.xcconfig"; path = "Target Support Files/Pods-YTAnimationDemo/Pods-YTAnimationDemo.debug.xcconfig"; sourceTree = ""; }; 9D5D73D720BB995C0065456B /* YTTransitionAnimationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YTTransitionAnimationViewController.swift; sourceTree = ""; }; 9D5D73D920BBD8A20065456B /* YTCombinationAnimationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YTCombinationAnimationViewController.swift; sourceTree = ""; }; 9D5D73DF20BE36390065456B /* DCPathItemButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPathItemButton.h; sourceTree = ""; }; @@ -101,37 +75,6 @@ 9D6E7DDE20B69B42007EB132 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 9D6E7DE120B69B42007EB132 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 9D6E7DE320B69B42007EB132 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9D6E7DF820B6A00F007EB132 /* ConstraintMultiplierTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintMultiplierTarget.swift; sourceTree = ""; }; - 9D6E7DFA20B6A00F007EB132 /* ConstraintDescription.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintDescription.swift; sourceTree = ""; }; - 9D6E7DFB20B6A00F007EB132 /* ConstraintMakerPriortizable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintMakerPriortizable.swift; sourceTree = ""; }; - 9D6E7DFC20B6A00F007EB132 /* ConstraintAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintAttributes.swift; sourceTree = ""; }; - 9D6E7DFD20B6A00F007EB132 /* ConstraintViewDSL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintViewDSL.swift; sourceTree = ""; }; - 9D6E7DFE20B6A00F007EB132 /* ConstraintPriorityTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintPriorityTarget.swift; sourceTree = ""; }; - 9D6E7DFF20B6A00F007EB132 /* ConstraintInsets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintInsets.swift; sourceTree = ""; }; - 9D6E7E0020B6A00F007EB132 /* ConstraintMakerFinalizable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintMakerFinalizable.swift; sourceTree = ""; }; - 9D6E7E0120B6A00F007EB132 /* ConstraintDSL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintDSL.swift; sourceTree = ""; }; - 9D6E7E0220B6A00F007EB132 /* ConstraintMakerExtendable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintMakerExtendable.swift; sourceTree = ""; }; - 9D6E7E0420B6A00F007EB132 /* ConstraintInsetTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintInsetTarget.swift; sourceTree = ""; }; - 9D6E7E0520B6A00F007EB132 /* SnapKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SnapKit.h; sourceTree = ""; }; - 9D6E7E0620B6A00F007EB132 /* ConstraintConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintConfig.swift; sourceTree = ""; }; - 9D6E7E0720B6A00F007EB132 /* UILayoutSupport+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UILayoutSupport+Extensions.swift"; sourceTree = ""; }; - 9D6E7E0820B6A00F007EB132 /* ConstraintView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintView.swift; sourceTree = ""; }; - 9D6E7E0920B6A00F007EB132 /* ConstraintLayoutGuide.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintLayoutGuide.swift; sourceTree = ""; }; - 9D6E7E0A20B6A00F007EB132 /* ConstraintLayoutSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintLayoutSupport.swift; sourceTree = ""; }; - 9D6E7E0B20B6A00F007EB132 /* ConstraintConstantTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintConstantTarget.swift; sourceTree = ""; }; - 9D6E7E0C20B6A00F007EB132 /* ConstraintOffsetTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintOffsetTarget.swift; sourceTree = ""; }; - 9D6E7E0D20B6A00F007EB132 /* ConstraintMakerEditable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintMakerEditable.swift; sourceTree = ""; }; - 9D6E7E0E20B6A00F007EB132 /* ConstraintMaker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintMaker.swift; sourceTree = ""; }; - 9D6E7E0F20B6A00F007EB132 /* ConstraintRelation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintRelation.swift; sourceTree = ""; }; - 9D6E7E1020B6A00F007EB132 /* ConstraintLayoutGuideDSL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintLayoutGuideDSL.swift; sourceTree = ""; }; - 9D6E7E1120B6A00F007EB132 /* ConstraintView+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ConstraintView+Extensions.swift"; sourceTree = ""; }; - 9D6E7E1220B6A00F007EB132 /* ConstraintItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintItem.swift; sourceTree = ""; }; - 9D6E7E1320B6A00F007EB132 /* Constraint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constraint.swift; sourceTree = ""; }; - 9D6E7E1420B6A00F007EB132 /* Debugging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Debugging.swift; sourceTree = ""; }; - 9D6E7E1520B6A00F007EB132 /* ConstraintRelatableTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintRelatableTarget.swift; sourceTree = ""; }; - 9D6E7E1720B6A00F007EB132 /* LayoutConstraint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayoutConstraint.swift; sourceTree = ""; }; - 9D6E7E1920B6A00F007EB132 /* ConstraintLayoutSupportDSL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintLayoutSupportDSL.swift; sourceTree = ""; }; - 9D6E7E1A20B6A00F007EB132 /* ConstraintMakerRelatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintMakerRelatable.swift; sourceTree = ""; }; 9D6E7E3E20B6A073007EB132 /* BaseConst.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseConst.swift; sourceTree = ""; }; 9D6E7E5120B79E87007EB132 /* YTBaseAnimationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YTBaseAnimationViewController.swift; sourceTree = ""; }; 9D6E7E5320B7A1B9007EB132 /* YTBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YTBaseViewController.swift; sourceTree = ""; }; @@ -144,12 +87,31 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8769614394667A1BE32A4C14 /* Pods_YTAnimationDemo.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 40A26D2B109A5253A4854BDA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 0AECA41A0EABFA0962FB7BBD /* Pods_YTAnimationDemo.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 652FB8202CADE4791304425B /* Pods */ = { + isa = PBXGroup; + children = ( + 3CCB4CF8CA0CB52E8344576D /* Pods-YTAnimationDemo.debug.xcconfig */, + 05AD958427B099DEEE6212AB /* Pods-YTAnimationDemo.release.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9D5D73DD20BE36390065456B /* 弹球 */ = { isa = PBXGroup; children = ( @@ -215,6 +177,8 @@ children = ( 9D6E7DD620B69B40007EB132 /* YTAnimationDemo */, 9D6E7DD520B69B40007EB132 /* Products */, + 652FB8202CADE4791304425B /* Pods */, + 40A26D2B109A5253A4854BDA /* Frameworks */, ); sourceTree = ""; }; @@ -235,7 +199,6 @@ 9D6E7E4D20B79DFC007EB132 /* 过渡动画 */, 9D6E7E5020B79DFD007EB132 /* 项目案例 */, 9D6E7E3D20B6A073007EB132 /* Base */, - 9D6E7DF720B6A00F007EB132 /* SnapKit */, 9D6E7DD720B69B40007EB132 /* AppDelegate.swift */, 9D5D73F220BE80740065456B /* YTAnimationDemo-Bridging-Header.h */, 9D6E7DD920B69B40007EB132 /* ViewController.swift */, @@ -247,44 +210,6 @@ path = YTAnimationDemo; sourceTree = ""; }; - 9D6E7DF720B6A00F007EB132 /* SnapKit */ = { - isa = PBXGroup; - children = ( - 9D6E7DF820B6A00F007EB132 /* ConstraintMultiplierTarget.swift */, - 9D6E7DFA20B6A00F007EB132 /* ConstraintDescription.swift */, - 9D6E7DFB20B6A00F007EB132 /* ConstraintMakerPriortizable.swift */, - 9D6E7DFC20B6A00F007EB132 /* ConstraintAttributes.swift */, - 9D6E7DFD20B6A00F007EB132 /* ConstraintViewDSL.swift */, - 9D6E7DFE20B6A00F007EB132 /* ConstraintPriorityTarget.swift */, - 9D6E7DFF20B6A00F007EB132 /* ConstraintInsets.swift */, - 9D6E7E0020B6A00F007EB132 /* ConstraintMakerFinalizable.swift */, - 9D6E7E0120B6A00F007EB132 /* ConstraintDSL.swift */, - 9D6E7E0220B6A00F007EB132 /* ConstraintMakerExtendable.swift */, - 9D6E7E0420B6A00F007EB132 /* ConstraintInsetTarget.swift */, - 9D6E7E0520B6A00F007EB132 /* SnapKit.h */, - 9D6E7E0620B6A00F007EB132 /* ConstraintConfig.swift */, - 9D6E7E0720B6A00F007EB132 /* UILayoutSupport+Extensions.swift */, - 9D6E7E0820B6A00F007EB132 /* ConstraintView.swift */, - 9D6E7E0920B6A00F007EB132 /* ConstraintLayoutGuide.swift */, - 9D6E7E0A20B6A00F007EB132 /* ConstraintLayoutSupport.swift */, - 9D6E7E0B20B6A00F007EB132 /* ConstraintConstantTarget.swift */, - 9D6E7E0C20B6A00F007EB132 /* ConstraintOffsetTarget.swift */, - 9D6E7E0D20B6A00F007EB132 /* ConstraintMakerEditable.swift */, - 9D6E7E0E20B6A00F007EB132 /* ConstraintMaker.swift */, - 9D6E7E0F20B6A00F007EB132 /* ConstraintRelation.swift */, - 9D6E7E1020B6A00F007EB132 /* ConstraintLayoutGuideDSL.swift */, - 9D6E7E1120B6A00F007EB132 /* ConstraintView+Extensions.swift */, - 9D6E7E1220B6A00F007EB132 /* ConstraintItem.swift */, - 9D6E7E1320B6A00F007EB132 /* Constraint.swift */, - 9D6E7E1420B6A00F007EB132 /* Debugging.swift */, - 9D6E7E1520B6A00F007EB132 /* ConstraintRelatableTarget.swift */, - 9D6E7E1720B6A00F007EB132 /* LayoutConstraint.swift */, - 9D6E7E1920B6A00F007EB132 /* ConstraintLayoutSupportDSL.swift */, - 9D6E7E1A20B6A00F007EB132 /* ConstraintMakerRelatable.swift */, - ); - path = SnapKit; - sourceTree = ""; - }; 9D6E7E3D20B6A073007EB132 /* Base */ = { isa = PBXGroup; children = ( @@ -345,10 +270,12 @@ isa = PBXNativeTarget; buildConfigurationList = 9D6E7DE620B69B42007EB132 /* Build configuration list for PBXNativeTarget "YTAnimationDemo" */; buildPhases = ( + 36E3859D3589927F5D91AEF4 /* [CP] Check Pods Manifest.lock */, 9D6E7DD020B69B40007EB132 /* Sources */, 9D6E7DD120B69B40007EB132 /* Frameworks */, 9D6E7DD220B69B40007EB132 /* Resources */, 9D6E7DF620B69F9B007EB132 /* Embed Frameworks */, + 2F88CECF35EECBF831865EFB /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -408,57 +335,69 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 2F88CECF35EECBF831865EFB /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-YTAnimationDemo/Pods-YTAnimationDemo-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-YTAnimationDemo/Pods-YTAnimationDemo-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-YTAnimationDemo/Pods-YTAnimationDemo-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 36E3859D3589927F5D91AEF4 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-YTAnimationDemo-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 9D6E7DD020B69B40007EB132 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9D6E7E1B20B6A00F007EB132 /* ConstraintMultiplierTarget.swift in Sources */, 9D6E7E5420B7A1B9007EB132 /* YTBaseViewController.swift in Sources */, - 9D6E7E2920B6A00F007EB132 /* UILayoutSupport+Extensions.swift in Sources */, 9D6E7DDA20B69B40007EB132 /* ViewController.swift in Sources */, 9D5D73EB20BE36390065456B /* DCPathCenterButton.m in Sources */, - 9D6E7E2D20B6A00F007EB132 /* ConstraintConstantTarget.swift in Sources */, - 9D6E7E2B20B6A00F007EB132 /* ConstraintLayoutGuide.swift in Sources */, 9D5D73FD20BE84580065456B /* DWBubbleMenuButton.m in Sources */, - 9D6E7E3320B6A00F007EB132 /* ConstraintView+Extensions.swift in Sources */, - 9D6E7E3020B6A00F007EB132 /* ConstraintMaker.swift in Sources */, - 9D6E7E3420B6A00F007EB132 /* ConstraintItem.swift in Sources */, - 9D6E7E3120B6A00F007EB132 /* ConstraintRelation.swift in Sources */, - 9D6E7E3220B6A00F007EB132 /* ConstraintLayoutGuideDSL.swift in Sources */, 9D5D73DA20BBD8A20065456B /* YTCombinationAnimationViewController.swift in Sources */, - 9D6E7E2420B6A00F007EB132 /* ConstraintDSL.swift in Sources */, - 9D6E7E1F20B6A00F007EB132 /* ConstraintAttributes.swift in Sources */, - 9D6E7E2720B6A00F007EB132 /* ConstraintInsetTarget.swift in Sources */, - 9D6E7E1E20B6A00F007EB132 /* ConstraintMakerPriortizable.swift in Sources */, - 9D6E7E2C20B6A00F007EB132 /* ConstraintLayoutSupport.swift in Sources */, 9D6E7E5220B79E87007EB132 /* YTBaseAnimationViewController.swift in Sources */, - 9D6E7E2E20B6A00F007EB132 /* ConstraintOffsetTarget.swift in Sources */, 9D5D73E920BE36390065456B /* DCPathButton.m in Sources */, - 9D6E7E2320B6A00F007EB132 /* ConstraintMakerFinalizable.swift in Sources */, 9D6E7E7820B7F512007EB132 /* YTGroupAnimationViewController.swift in Sources */, 9D5D740020BE848A0065456B /* YTProgressView.swift in Sources */, 9D6E7DD820B69B40007EB132 /* AppDelegate.swift in Sources */, - 9D6E7E3B20B6A00F007EB132 /* ConstraintLayoutSupportDSL.swift in Sources */, 9D5D73FC20BE84580065456B /* MCFireworksView.m in Sources */, - 9D6E7E2A20B6A00F007EB132 /* ConstraintView.swift in Sources */, 9D6E7E5C20B7B4B6007EB132 /* YTKeyFrameAnimationViewController.swift in Sources */, - 9D6E7E2020B6A00F007EB132 /* ConstraintViewDSL.swift in Sources */, - 9D6E7E3920B6A00F007EB132 /* LayoutConstraint.swift in Sources */, 9D5D73EA20BE36390065456B /* DCPathItemButton.m in Sources */, - 9D6E7E3520B6A00F007EB132 /* Constraint.swift in Sources */, 9D5D73D820BB995C0065456B /* YTTransitionAnimationViewController.swift in Sources */, 9D6E7E3F20B6A073007EB132 /* BaseConst.swift in Sources */, 9D5D73FB20BE84580065456B /* MCFireworksButton.m in Sources */, - 9D6E7E3620B6A00F007EB132 /* Debugging.swift in Sources */, - 9D6E7E3720B6A00F007EB132 /* ConstraintRelatableTarget.swift in Sources */, - 9D6E7E2F20B6A00F007EB132 /* ConstraintMakerEditable.swift in Sources */, - 9D6E7E2120B6A00F007EB132 /* ConstraintPriorityTarget.swift in Sources */, - 9D6E7E2820B6A00F007EB132 /* ConstraintConfig.swift in Sources */, - 9D6E7E2220B6A00F007EB132 /* ConstraintInsets.swift in Sources */, - 9D6E7E1D20B6A00F007EB132 /* ConstraintDescription.swift in Sources */, - 9D6E7E3C20B6A00F007EB132 /* ConstraintMakerRelatable.swift in Sources */, - 9D6E7E2520B6A00F007EB132 /* ConstraintMakerExtendable.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -600,6 +539,7 @@ }; 9D6E7DE720B69B42007EB132 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 3CCB4CF8CA0CB52E8344576D /* Pods-YTAnimationDemo.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -614,13 +554,14 @@ PRODUCT_BUNDLE_IDENTIFIER = com.qeegoo.YTAnimationDemo; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "YTAnimationDemo/YTAnimationDemo-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 9D6E7DE820B69B42007EB132 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 05AD958427B099DEEE6212AB /* Pods-YTAnimationDemo.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -635,7 +576,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.qeegoo.YTAnimationDemo; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "YTAnimationDemo/YTAnimationDemo-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/YTAnimationDemo.xcworkspace/contents.xcworkspacedata b/YTAnimationDemo.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..eeb1c7a --- /dev/null +++ b/YTAnimationDemo.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/YTAnimationDemo/AppDelegate.swift b/YTAnimationDemo/AppDelegate.swift index b829c51..c5c7c31 100644 --- a/YTAnimationDemo/AppDelegate.swift +++ b/YTAnimationDemo/AppDelegate.swift @@ -7,6 +7,7 @@ // import UIKit +@_exported import SnapKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -14,7 +15,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { window = UIWindow.init(frame: kScreenBounds) window?.makeKeyAndVisible() diff --git a/YTAnimationDemo/Base/YTBaseViewController.swift b/YTAnimationDemo/Base/YTBaseViewController.swift index 14ff3a9..2f2bc75 100644 --- a/YTAnimationDemo/Base/YTBaseViewController.swift +++ b/YTAnimationDemo/Base/YTBaseViewController.swift @@ -33,7 +33,7 @@ class YTBaseViewController: UIViewController { extension YTBaseViewController{ - func playBtnClick(btn: UIButton) { + @objc func playBtnClick(btn: UIButton) { } diff --git a/YTAnimationDemo/SnapKit/Constraint.swift b/YTAnimationDemo/SnapKit/Constraint.swift deleted file mode 100755 index b93a8d9..0000000 --- a/YTAnimationDemo/SnapKit/Constraint.swift +++ /dev/null @@ -1,268 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - -public class Constraint { - - internal let sourceLocation: (String, UInt) - internal let label: String? - - private let from: ConstraintItem - private let to: ConstraintItem - private let relation: ConstraintRelation - private let multiplier: ConstraintMultiplierTarget - private var constant: ConstraintConstantTarget { - didSet { - self.updateConstantAndPriorityIfNeeded() - } - } - private var priority: ConstraintPriorityTarget { - didSet { - self.updateConstantAndPriorityIfNeeded() - } - } - private var layoutConstraints: [LayoutConstraint] - - // MARK: Initialization - - internal init(from: ConstraintItem, - to: ConstraintItem, - relation: ConstraintRelation, - sourceLocation: (String, UInt), - label: String?, - multiplier: ConstraintMultiplierTarget, - constant: ConstraintConstantTarget, - priority: ConstraintPriorityTarget) { - self.from = from - self.to = to - self.relation = relation - self.sourceLocation = sourceLocation - self.label = label - self.multiplier = multiplier - self.constant = constant - self.priority = priority - self.layoutConstraints = [] - - // get attributes - let layoutFromAttributes = self.from.attributes.layoutAttributes - let layoutToAttributes = self.to.attributes.layoutAttributes - - // get layout from - let layoutFrom: ConstraintView = self.from.view! - - // get relation - let layoutRelation = self.relation.layoutRelation - - for layoutFromAttribute in layoutFromAttributes { - // get layout to attribute - let layoutToAttribute: NSLayoutAttribute - #if os(iOS) || os(tvOS) - if layoutToAttributes.count > 0 { - if self.from.attributes == .edges && self.to.attributes == .margins { - switch layoutFromAttribute { - case .left: - layoutToAttribute = .leftMargin - case .right: - layoutToAttribute = .rightMargin - case .top: - layoutToAttribute = .topMargin - case .bottom: - layoutToAttribute = .bottomMargin - default: - fatalError() - } - } else if self.from.attributes == .margins && self.to.attributes == .edges { - switch layoutFromAttribute { - case .leftMargin: - layoutToAttribute = .left - case .rightMargin: - layoutToAttribute = .right - case .topMargin: - layoutToAttribute = .top - case .bottomMargin: - layoutToAttribute = .bottom - default: - fatalError() - } - } else if self.from.attributes == self.to.attributes { - layoutToAttribute = layoutFromAttribute - } else { - layoutToAttribute = layoutToAttributes[0] - } - } else { - layoutToAttribute = layoutFromAttribute - } - #else - if self.from.attributes == self.to.attributes { - layoutToAttribute = layoutFromAttribute - } else if layoutToAttributes.count > 0 { - layoutToAttribute = layoutToAttributes[0] - } else { - layoutToAttribute = layoutFromAttribute - } - #endif - - // get layout constant - let layoutConstant: CGFloat = self.constant.constraintConstantTargetValueFor(layoutAttribute: layoutToAttribute) - - // get layout to - var layoutTo: AnyObject? = self.to.target - - // use superview if possible - if layoutTo == nil && layoutToAttribute != .width && layoutToAttribute != .height { - layoutTo = layoutFrom.superview - } - - // create layout constraint - let layoutConstraint = LayoutConstraint( - item: layoutFrom, - attribute: layoutFromAttribute, - relatedBy: layoutRelation, - toItem: layoutTo, - attribute: layoutToAttribute, - multiplier: self.multiplier.constraintMultiplierTargetValue, - constant: layoutConstant - ) - - // set label - layoutConstraint.label = self.label - - // set priority - layoutConstraint.priority = self.priority.constraintPriorityTargetValue - - // set constraint - layoutConstraint.constraint = self - - // append - self.layoutConstraints.append(layoutConstraint) - } - } - - // MARK: Public - - @available(*, deprecated:3.0, message:"Use activate().") - public func install() { - self.activate() - } - - @available(*, deprecated:3.0, message:"Use deactivate().") - public func uninstall() { - self.deactivate() - } - - public func activate() { - self.activateIfNeeded() - } - - public func deactivate() { - self.deactivateIfNeeded() - } - - @discardableResult - public func update(offset: ConstraintOffsetTarget) -> Constraint { - self.constant = offset.constraintOffsetTargetValue - return self - } - - @discardableResult - public func update(inset: ConstraintInsetTarget) -> Constraint { - self.constant = inset.constraintInsetTargetValue - return self - } - - @discardableResult - public func update(priority: ConstraintPriorityTarget) -> Constraint { - self.priority = priority.constraintPriorityTargetValue - return self - } - - @available(*, deprecated:3.0, message:"Use update(offset: ConstraintOffsetTarget) instead.") - public func updateOffset(amount: ConstraintOffsetTarget) -> Void { self.update(offset: amount) } - - @available(*, deprecated:3.0, message:"Use update(inset: ConstraintInsetTarget) instead.") - public func updateInsets(amount: ConstraintInsetTarget) -> Void { self.update(inset: amount) } - - @available(*, deprecated:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") - public func updatePriority(amount: ConstraintPriorityTarget) -> Void { self.update(priority: amount) } - - @available(*, obsoleted:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") - public func updatePriorityRequired() -> Void {} - - @available(*, obsoleted:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") - public func updatePriorityHigh() -> Void { fatalError("Must be implemented by Concrete subclass.") } - - @available(*, obsoleted:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") - public func updatePriorityMedium() -> Void { fatalError("Must be implemented by Concrete subclass.") } - - @available(*, obsoleted:3.0, message:"Use update(priority: ConstraintPriorityTarget) instead.") - public func updatePriorityLow() -> Void { fatalError("Must be implemented by Concrete subclass.") } - - // MARK: Internal - - internal func updateConstantAndPriorityIfNeeded() { - for layoutConstraint in self.layoutConstraints { - let attribute = (layoutConstraint.secondAttribute == .notAnAttribute) ? layoutConstraint.firstAttribute : layoutConstraint.secondAttribute - layoutConstraint.constant = self.constant.constraintConstantTargetValueFor(layoutAttribute: attribute) - layoutConstraint.priority = self.priority.constraintPriorityTargetValue - } - } - - internal func activateIfNeeded(updatingExisting: Bool = false) { - guard let view = self.from.view else { - print("WARNING: SnapKit failed to get from view from constraint. Activate will be a no-op.") - return - } - let layoutConstraints = self.layoutConstraints - let existingLayoutConstraints = view.snp.constraints.map({ $0.layoutConstraints }).reduce([]) { $0 + $1 } - - if updatingExisting { - for layoutConstraint in layoutConstraints { - let existingLayoutConstraint = existingLayoutConstraints.first { $0 == layoutConstraint } - guard let updateLayoutConstraint = existingLayoutConstraint else { - fatalError("Updated constraint could not find existing matching constraint to update: \(layoutConstraint)") - } - - let updateLayoutAttribute = (updateLayoutConstraint.secondAttribute == .notAnAttribute) ? updateLayoutConstraint.firstAttribute : updateLayoutConstraint.secondAttribute - updateLayoutConstraint.constant = self.constant.constraintConstantTargetValueFor(layoutAttribute: updateLayoutAttribute) - } - } else { - NSLayoutConstraint.activate(layoutConstraints) - view.snp.add(constraints: [self]) - } - } - - internal func deactivateIfNeeded() { - guard let view = self.from.view else { - print("WARNING: SnapKit failed to get from view from constraint. Deactivate will be a no-op.") - return - } - let layoutConstraints = self.layoutConstraints - NSLayoutConstraint.deactivate(layoutConstraints) - view.snp.remove(constraints: [self]) - } -} diff --git a/YTAnimationDemo/SnapKit/ConstraintAttributes.swift b/YTAnimationDemo/SnapKit/ConstraintAttributes.swift deleted file mode 100755 index 7236d24..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintAttributes.swift +++ /dev/null @@ -1,190 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -internal struct ConstraintAttributes: OptionSet { - - internal init(rawValue: UInt) { - self.rawValue = rawValue - } - internal init(_ rawValue: UInt) { - self.init(rawValue: rawValue) - } - internal init(nilLiteral: ()) { - self.rawValue = 0 - } - - internal private(set) var rawValue: UInt - internal static var allZeros: ConstraintAttributes { return self.init(0) } - internal static func convertFromNilLiteral() -> ConstraintAttributes { return self.init(0) } - internal var boolValue: Bool { return self.rawValue != 0 } - - internal func toRaw() -> UInt { return self.rawValue } - internal static func fromRaw(_ raw: UInt) -> ConstraintAttributes? { return self.init(raw) } - internal static func fromMask(_ raw: UInt) -> ConstraintAttributes { return self.init(raw) } - - // normal - - internal static var none: ConstraintAttributes { return self.init(0) } - internal static var left: ConstraintAttributes { return self.init(1) } - internal static var top: ConstraintAttributes { return self.init(2) } - internal static var right: ConstraintAttributes { return self.init(4) } - internal static var bottom: ConstraintAttributes { return self.init(8) } - internal static var leading: ConstraintAttributes { return self.init(16) } - internal static var trailing: ConstraintAttributes { return self.init(32) } - internal static var width: ConstraintAttributes { return self.init(64) } - internal static var height: ConstraintAttributes { return self.init(128) } - internal static var centerX: ConstraintAttributes { return self.init(256) } - internal static var centerY: ConstraintAttributes { return self.init(512) } - internal static var lastBaseline: ConstraintAttributes { return self.init(1024) } - - @available(iOS 8.0, OSX 10.11, *) - internal static var firstBaseline: ConstraintAttributes { return self.init(2048) } - - @available(iOS 8.0, *) - internal static var leftMargin: ConstraintAttributes { return self.init(4096) } - - @available(iOS 8.0, *) - internal static var rightMargin: ConstraintAttributes { return self.init(8192) } - - @available(iOS 8.0, *) - internal static var topMargin: ConstraintAttributes { return self.init(16384) } - - @available(iOS 8.0, *) - internal static var bottomMargin: ConstraintAttributes { return self.init(32768) } - - @available(iOS 8.0, *) - internal static var leadingMargin: ConstraintAttributes { return self.init(65536) } - - @available(iOS 8.0, *) - internal static var trailingMargin: ConstraintAttributes { return self.init(131072) } - - @available(iOS 8.0, *) - internal static var centerXWithinMargins: ConstraintAttributes { return self.init(262144) } - - @available(iOS 8.0, *) - internal static var centerYWithinMargins: ConstraintAttributes { return self.init(524288) } - - // aggregates - - internal static var edges: ConstraintAttributes { return self.init(15) } - internal static var size: ConstraintAttributes { return self.init(192) } - internal static var center: ConstraintAttributes { return self.init(768) } - - @available(iOS 8.0, *) - internal static var margins: ConstraintAttributes { return self.init(61440) } - - @available(iOS 8.0, *) - internal static var centerWithinMargins: ConstraintAttributes { return self.init(786432) } - - internal var layoutAttributes:[NSLayoutAttribute] { - var attrs = [NSLayoutAttribute]() - if (self.contains(ConstraintAttributes.left)) { - attrs.append(.left) - } - if (self.contains(ConstraintAttributes.top)) { - attrs.append(.top) - } - if (self.contains(ConstraintAttributes.right)) { - attrs.append(.right) - } - if (self.contains(ConstraintAttributes.bottom)) { - attrs.append(.bottom) - } - if (self.contains(ConstraintAttributes.leading)) { - attrs.append(.leading) - } - if (self.contains(ConstraintAttributes.trailing)) { - attrs.append(.trailing) - } - if (self.contains(ConstraintAttributes.width)) { - attrs.append(.width) - } - if (self.contains(ConstraintAttributes.height)) { - attrs.append(.height) - } - if (self.contains(ConstraintAttributes.centerX)) { - attrs.append(.centerX) - } - if (self.contains(ConstraintAttributes.centerY)) { - attrs.append(.centerY) - } - if (self.contains(ConstraintAttributes.lastBaseline)) { - attrs.append(.lastBaseline) - } - - #if os(iOS) || os(tvOS) - if (self.contains(ConstraintAttributes.firstBaseline)) { - attrs.append(.firstBaseline) - } - if (self.contains(ConstraintAttributes.leftMargin)) { - attrs.append(.leftMargin) - } - if (self.contains(ConstraintAttributes.rightMargin)) { - attrs.append(.rightMargin) - } - if (self.contains(ConstraintAttributes.topMargin)) { - attrs.append(.topMargin) - } - if (self.contains(ConstraintAttributes.bottomMargin)) { - attrs.append(.bottomMargin) - } - if (self.contains(ConstraintAttributes.leadingMargin)) { - attrs.append(.leadingMargin) - } - if (self.contains(ConstraintAttributes.trailingMargin)) { - attrs.append(.trailingMargin) - } - if (self.contains(ConstraintAttributes.centerXWithinMargins)) { - attrs.append(.centerXWithinMargins) - } - if (self.contains(ConstraintAttributes.centerYWithinMargins)) { - attrs.append(.centerYWithinMargins) - } - #endif - - return attrs - } -} - -internal func + (left: ConstraintAttributes, right: ConstraintAttributes) -> ConstraintAttributes { - return left.union(right) -} - -internal func +=(left: inout ConstraintAttributes, right: ConstraintAttributes) { - left.formUnion(right) -} - -internal func -=(left: inout ConstraintAttributes, right: ConstraintAttributes) { - left.subtract(right) -} - -internal func ==(left: ConstraintAttributes, right: ConstraintAttributes) -> Bool { - return left.rawValue == right.rawValue -} diff --git a/YTAnimationDemo/SnapKit/ConstraintConfig.swift b/YTAnimationDemo/SnapKit/ConstraintConfig.swift deleted file mode 100755 index 2746b7d..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintConfig.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit - public typealias ConstraintInterfaceLayoutDirection = UIUserInterfaceLayoutDirection -#else - import AppKit - public typealias ConstraintInterfaceLayoutDirection = NSUserInterfaceLayoutDirection -#endif - - -public struct ConstraintConfig { - - public static var interfaceLayoutDirection: ConstraintInterfaceLayoutDirection = .leftToRight - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintConstantTarget.swift b/YTAnimationDemo/SnapKit/ConstraintConstantTarget.swift deleted file mode 100755 index 801bb79..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintConstantTarget.swift +++ /dev/null @@ -1,147 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public protocol ConstraintConstantTarget { -} - -extension CGPoint: ConstraintConstantTarget { -} - -extension CGSize: ConstraintConstantTarget { -} - -extension ConstraintInsets: ConstraintConstantTarget { -} - -extension ConstraintConstantTarget { - - internal func constraintConstantTargetValueFor(layoutAttribute: NSLayoutAttribute) -> CGFloat { - if let value = self as? CGFloat { - return value - } - - if let value = self as? Float { - return CGFloat(value) - } - - if let value = self as? Double { - return CGFloat(value) - } - - if let value = self as? Int { - return CGFloat(value) - } - - if let value = self as? UInt { - return CGFloat(value) - } - - if let value = self as? CGSize { - if layoutAttribute == .width { - return value.width - } else if layoutAttribute == .height { - return value.height - } else { - return 0.0 - } - } - - if let value = self as? CGPoint { - #if os(iOS) || os(tvOS) - switch layoutAttribute { - case .left, .right, .leading, .trailing, .centerX, .leftMargin, .rightMargin, .leadingMargin, .trailingMargin, .centerXWithinMargins: - return value.x - case .top, .bottom, .centerY, .topMargin, .bottomMargin, .centerYWithinMargins, .lastBaseline, .firstBaseline: - return value.y - case .width, .height, .notAnAttribute: - return 0.0 - } - #else - switch layoutAttribute { - case .left, .right, .leading, .trailing, .centerX: - return value.x - case .top, .bottom, .centerY, .lastBaseline, .firstBaseline: - return value.y - case .width, .height, .notAnAttribute: - return 0.0 - } - #endif - } - - if let value = self as? ConstraintInsets { - #if os(iOS) || os(tvOS) - switch layoutAttribute { - case .left, .leftMargin, .centerX, .centerXWithinMargins: - return value.left - case .top, .topMargin, .centerY, .centerYWithinMargins, .lastBaseline, .firstBaseline: - return value.top - case .right, .rightMargin: - return -value.right - case .bottom, .bottomMargin: - return -value.bottom - case .leading, .leadingMargin: - return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right - case .trailing, .trailingMargin: - return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left - case .width: - return -(value.left + value.right) - case .height: - return -(value.top + value.bottom) - case .notAnAttribute: - return 0.0 - } - #else - switch layoutAttribute { - case .left, .centerX: - return value.left - case .top, .centerY, .lastBaseline, .firstBaseline: - return value.top - case .right: - return -value.right - case .bottom: - return -value.bottom - case .leading: - return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right - case .trailing: - return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left - case .width: - return -(value.left + value.right) - case .height: - return -(value.top + value.bottom) - case .notAnAttribute: - return 0.0 - } - #endif - } - - return 0.0 - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintDSL.swift b/YTAnimationDemo/SnapKit/ConstraintDSL.swift deleted file mode 100755 index cda83a0..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintDSL.swift +++ /dev/null @@ -1,179 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public protocol ConstraintDSL { - - var target: AnyObject? { get } - - func setLabel(_ value: String?) - func label() -> String? - -} -extension ConstraintDSL { - - public func setLabel(_ value: String?) { - objc_setAssociatedObject(self.target, &labelKey, value, .OBJC_ASSOCIATION_COPY_NONATOMIC) - } - public func label() -> String? { - return objc_getAssociatedObject(self.target, &labelKey) as? String - } - -} -private var labelKey: UInt8 = 0 - - -public protocol ConstraintAttributesDSL: ConstraintDSL { -} -extension ConstraintAttributesDSL { - - // MARK: Basics - - public var left: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.left) - } - - public var top: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top) - } - - public var right: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.right) - } - - public var bottom: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom) - } - - public var leading: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.leading) - } - - public var trailing: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.trailing) - } - - public var width: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.width) - } - - public var height: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height) - } - - public var centerX: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerX) - } - - public var centerY: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerY) - } - - public var edges: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.edges) - } - - public var size: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.size) - } - - public var center: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.center) - } - - // MARK: Baselines - - @available(*, deprecated:3.0, message:"Use .lastBaseline instead") - public var baseline: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.lastBaseline) - } - - @available(iOS 8.0, OSX 10.11, *) - public var lastBaseline: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.lastBaseline) - } - - @available(iOS 8.0, OSX 10.11, *) - public var firstBaseline: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.firstBaseline) - } - - // MARK: Margins - - @available(iOS 8.0, *) - public var leftMargin: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.leftMargin) - } - - @available(iOS 8.0, *) - public var topMargin: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.topMargin) - } - - @available(iOS 8.0, *) - public var rightMargin: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.rightMargin) - } - - @available(iOS 8.0, *) - public var bottomMargin: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottomMargin) - } - - @available(iOS 8.0, *) - public var leadingMargin: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.leadingMargin) - } - - @available(iOS 8.0, *) - public var trailingMargin: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.trailingMargin) - } - - @available(iOS 8.0, *) - public var centerXWithinMargins: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerXWithinMargins) - } - - @available(iOS 8.0, *) - public var centerYWithinMargins: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerYWithinMargins) - } - - @available(iOS 8.0, *) - public var margins: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.margins) - } - - @available(iOS 8.0, *) - public var centerWithinMargins: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerWithinMargins) - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintDescription.swift b/YTAnimationDemo/SnapKit/ConstraintDescription.swift deleted file mode 100755 index d961fb5..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintDescription.swift +++ /dev/null @@ -1,69 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public class ConstraintDescription { - - internal let view: ConstraintView - internal var attributes: ConstraintAttributes - internal var relation: ConstraintRelation? = nil - internal var sourceLocation: (String, UInt)? = nil - internal var label: String? = nil - internal var related: ConstraintItem? = nil - internal var multiplier: ConstraintMultiplierTarget = 1.0 - internal var constant: ConstraintConstantTarget = 0.0 - internal var priority: ConstraintPriorityTarget = 1000.0 - internal lazy var constraint: Constraint? = { - guard let relation = self.relation, - let related = self.related, - let sourceLocation = self.sourceLocation else { - return nil - } - let from = ConstraintItem(target: self.view, attributes: self.attributes) - - return Constraint( - from: from, - to: related, - relation: relation, - sourceLocation: sourceLocation, - label: self.label, - multiplier: self.multiplier, - constant: self.constant, - priority: self.priority - ) - }() - - // MARK: Initialization - - internal init(view: ConstraintView, attributes: ConstraintAttributes) { - self.view = view - self.attributes = attributes - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintInsetTarget.swift b/YTAnimationDemo/SnapKit/ConstraintInsetTarget.swift deleted file mode 100755 index ba8a0f3..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintInsetTarget.swift +++ /dev/null @@ -1,72 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public protocol ConstraintInsetTarget: ConstraintConstantTarget { -} - -extension Int: ConstraintInsetTarget { -} - -extension UInt: ConstraintInsetTarget { -} - -extension Float: ConstraintInsetTarget { -} - -extension Double: ConstraintInsetTarget { -} - -extension CGFloat: ConstraintInsetTarget { -} - -extension ConstraintInsets: ConstraintInsetTarget { -} - -extension ConstraintInsetTarget { - - internal var constraintInsetTargetValue: ConstraintInsets { - if let amount = self as? ConstraintInsets { - return amount - } else if let amount = self as? Float { - return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) - } else if let amount = self as? Double { - return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) - } else if let amount = self as? CGFloat { - return ConstraintInsets(top: amount, left: amount, bottom: amount, right: amount) - } else if let amount = self as? Int { - return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) - } else if let amount = self as? UInt { - return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) - } else { - return ConstraintInsets(top: 0, left: 0, bottom: 0, right: 0) - } - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintInsets.swift b/YTAnimationDemo/SnapKit/ConstraintInsets.swift deleted file mode 100755 index 6ecac6b..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintInsets.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -#if os(iOS) || os(tvOS) - public typealias ConstraintInsets = UIEdgeInsets -#else - public typealias ConstraintInsets = EdgeInsets -#endif diff --git a/YTAnimationDemo/SnapKit/ConstraintItem.swift b/YTAnimationDemo/SnapKit/ConstraintItem.swift deleted file mode 100755 index a9477da..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintItem.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public class ConstraintItem: Equatable { - - internal weak var target: AnyObject? - internal let attributes: ConstraintAttributes - - internal init(target: AnyObject?, attributes: ConstraintAttributes) { - self.target = target - self.attributes = attributes - } - - internal var view: ConstraintView? { - return self.target as? ConstraintView - } - -} - -public func ==(lhs: ConstraintItem, rhs: ConstraintItem) -> Bool { - // pointer equality - guard lhs !== rhs else { - return true - } - - // must both have valid targets and identical attributes - guard let target1 = lhs.target, - let target2 = rhs.target, - target1 === target2 && lhs.attributes == rhs.attributes else { - return false - } - - return true -} diff --git a/YTAnimationDemo/SnapKit/ConstraintLayoutGuide.swift b/YTAnimationDemo/SnapKit/ConstraintLayoutGuide.swift deleted file mode 100755 index f6eba82..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintLayoutGuide.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -#if os(iOS) || os(tvOS) - @available(iOS 9.0, *) - public typealias ConstraintLayoutGuide = UILayoutGuide -#else - public class ConstraintLayoutGuide {} -#endif diff --git a/YTAnimationDemo/SnapKit/ConstraintLayoutGuideDSL.swift b/YTAnimationDemo/SnapKit/ConstraintLayoutGuideDSL.swift deleted file mode 100755 index 62bd9b4..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintLayoutGuideDSL.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -@available(iOS 9.0, *) -public struct ConstraintLayoutGuideDSL: ConstraintAttributesDSL { - - public var target: AnyObject? { - return self.guide - } - - internal let guide: ConstraintLayoutGuide - - internal init(guide: ConstraintLayoutGuide) { - self.guide = guide - - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintLayoutSupport.swift b/YTAnimationDemo/SnapKit/ConstraintLayoutSupport.swift deleted file mode 100755 index e92e9fb..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintLayoutSupport.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -#if os(iOS) || os(tvOS) - @available(iOS 8.0, *) - public typealias ConstraintLayoutSupport = UILayoutSupport -#else - public class ConstraintLayoutSupport {} -#endif diff --git a/YTAnimationDemo/SnapKit/ConstraintLayoutSupportDSL.swift b/YTAnimationDemo/SnapKit/ConstraintLayoutSupportDSL.swift deleted file mode 100755 index 5d6ae89..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintLayoutSupportDSL.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -@available(iOS 8.0, *) -public struct ConstraintLayoutSupportDSL: ConstraintDSL { - - public var target: AnyObject? { - return self.support - } - - internal let support: ConstraintLayoutSupport - - internal init(support: ConstraintLayoutSupport) { - self.support = support - - } - - public var top: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top) - } - - public var bottom: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom) - } - - public var height: ConstraintItem { - return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height) - } -} diff --git a/YTAnimationDemo/SnapKit/ConstraintMaker.swift b/YTAnimationDemo/SnapKit/ConstraintMaker.swift deleted file mode 100755 index 73bc3cd..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintMaker.swift +++ /dev/null @@ -1,206 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - -public class ConstraintMaker { - - public var left: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.left) - } - - public var top: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.top) - } - - public var bottom: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.bottom) - } - - public var right: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.right) - } - - public var leading: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.leading) - } - - public var trailing: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.trailing) - } - - public var width: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.width) - } - - public var height: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.height) - } - - public var centerX: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.centerX) - } - - public var centerY: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.centerY) - } - - @available(*, deprecated:3.0, message:"Use lastBaseline instead") - public var baseline: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.lastBaseline) - } - - public var lastBaseline: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.lastBaseline) - } - - @available(iOS 8.0, OSX 10.11, *) - public var firstBaseline: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.firstBaseline) - } - - @available(iOS 8.0, *) - public var leftMargin: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.leftMargin) - } - - @available(iOS 8.0, *) - public var rightMargin: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.rightMargin) - } - - @available(iOS 8.0, *) - public var bottomMargin: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.bottomMargin) - } - - @available(iOS 8.0, *) - public var leadingMargin: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.leadingMargin) - } - - @available(iOS 8.0, *) - public var trailingMargin: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.trailingMargin) - } - - @available(iOS 8.0, *) - public var centerXWithinMargins: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.centerXWithinMargins) - } - - @available(iOS 8.0, *) - public var centerYWithinMargins: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.centerYWithinMargins) - } - - public var edges: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.edges) - } - public var size: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.size) - } - public var center: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.center) - } - - @available(iOS 8.0, *) - public var margins: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.margins) - } - - @available(iOS 8.0, *) - public var centerWithinMargins: ConstraintMakerExtendable { - return self.makeExtendableWithAttributes(.centerWithinMargins) - } - - private let view: ConstraintView - private var descriptions = [ConstraintDescription]() - - internal init(view: ConstraintView) { - self.view = view - self.view.translatesAutoresizingMaskIntoConstraints = false - } - - internal func makeExtendableWithAttributes(_ attributes: ConstraintAttributes) -> ConstraintMakerExtendable { - let description = ConstraintDescription(view: self.view, attributes: attributes) - self.descriptions.append(description) - return ConstraintMakerExtendable(description) - } - - internal static func prepareConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { - let maker = ConstraintMaker(view: view) - closure(maker) - let constraints = maker.descriptions - .map { $0.constraint } - .filter { $0 != nil } - .map { $0! } - return constraints - } - - internal static func makeConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) { - let maker = ConstraintMaker(view: view) - closure(maker) - let constraints = maker.descriptions - .map { $0.constraint } - .filter { $0 != nil } - .map { $0! } - for constraint in constraints { - constraint.activateIfNeeded(updatingExisting: false) - } - } - - internal static func remakeConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) { - self.removeConstraints(view: view) - self.makeConstraints(view: view, closure: closure) - } - - internal static func updateConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) { - guard view.snp.constraints.count > 0 else { - self.makeConstraints(view: view, closure: closure) - return - } - - let maker = ConstraintMaker(view: view) - closure(maker) - let constraints = maker.descriptions - .map { $0.constraint } - .filter { $0 != nil } - .map { $0! } - for constraint in constraints { - constraint.activateIfNeeded(updatingExisting: true) - } - } - - internal static func removeConstraints(view: ConstraintView) { - let constraints = view.snp.constraints - for constraint in constraints { - constraint.deactivateIfNeeded() - } - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintMakerEditable.swift b/YTAnimationDemo/SnapKit/ConstraintMakerEditable.swift deleted file mode 100755 index fb88c41..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintMakerEditable.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public class ConstraintMakerEditable: ConstraintMakerPriortizable { - - @discardableResult - public func multipliedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { - self.description.multiplier = amount - return self - } - - @discardableResult - public func dividedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { - return self.multipliedBy(1.0 / amount.constraintMultiplierTargetValue) - } - - @discardableResult - public func offset(_ amount: ConstraintOffsetTarget) -> ConstraintMakerEditable { - self.description.constant = amount.constraintOffsetTargetValue - return self - } - - @discardableResult - public func inset(_ amount: ConstraintInsetTarget) -> ConstraintMakerEditable { - self.description.constant = amount.constraintInsetTargetValue - return self - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintMakerExtendable.swift b/YTAnimationDemo/SnapKit/ConstraintMakerExtendable.swift deleted file mode 100755 index 658c833..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintMakerExtendable.swift +++ /dev/null @@ -1,163 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public class ConstraintMakerExtendable: ConstraintMakerRelatable { - - public var left: ConstraintMakerExtendable { - self.description.attributes += .left - return self - } - - public var top: ConstraintMakerExtendable { - self.description.attributes += .top - return self - } - - public var bottom: ConstraintMakerExtendable { - self.description.attributes += .bottom - return self - } - - public var right: ConstraintMakerExtendable { - self.description.attributes += .right - return self - } - - public var leading: ConstraintMakerExtendable { - self.description.attributes += .leading - return self - } - - public var trailing: ConstraintMakerExtendable { - self.description.attributes += .trailing - return self - } - - public var width: ConstraintMakerExtendable { - self.description.attributes += .width - return self - } - - public var height: ConstraintMakerExtendable { - self.description.attributes += .height - return self - } - - public var centerX: ConstraintMakerExtendable { - self.description.attributes += .centerX - return self - } - - public var centerY: ConstraintMakerExtendable { - self.description.attributes += .centerY - return self - } - - @available(*, deprecated:3.0, message:"Use lastBaseline instead") - public var baseline: ConstraintMakerExtendable { - self.description.attributes += .lastBaseline - return self - } - - public var lastBaseline: ConstraintMakerExtendable { - self.description.attributes += .lastBaseline - return self - } - - @available(iOS 8.0, OSX 10.11, *) - public var firstBaseline: ConstraintMakerExtendable { - self.description.attributes += .firstBaseline - return self - } - - @available(iOS 8.0, *) - public var leftMargin: ConstraintMakerExtendable { - self.description.attributes += .leftMargin - return self - } - - @available(iOS 8.0, *) - public var rightMargin: ConstraintMakerExtendable { - self.description.attributes += .rightMargin - return self - } - - @available(iOS 8.0, *) - public var bottomMargin: ConstraintMakerExtendable { - self.description.attributes += .bottomMargin - return self - } - - @available(iOS 8.0, *) - public var leadingMargin: ConstraintMakerExtendable { - self.description.attributes += .leadingMargin - return self - } - - @available(iOS 8.0, *) - public var trailingMargin: ConstraintMakerExtendable { - self.description.attributes += .trailingMargin - return self - } - - @available(iOS 8.0, *) - public var centerXWithinMargins: ConstraintMakerExtendable { - self.description.attributes += .centerXWithinMargins - return self - } - - @available(iOS 8.0, *) - public var centerYWithinMargins: ConstraintMakerExtendable { - self.description.attributes += .centerYWithinMargins - return self - } - - public var edges: ConstraintMakerExtendable { - self.description.attributes += .edges - return self - } - public var size: ConstraintMakerExtendable { - self.description.attributes += .size - return self - } - - @available(iOS 8.0, *) - public var margins: ConstraintMakerExtendable { - self.description.attributes += .margins - return self - } - - @available(iOS 8.0, *) - public var centerWithinMargins: ConstraintMakerExtendable { - self.description.attributes += .centerWithinMargins - return self - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintMakerFinalizable.swift b/YTAnimationDemo/SnapKit/ConstraintMakerFinalizable.swift deleted file mode 100755 index 4e1379e..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintMakerFinalizable.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public class ConstraintMakerFinalizable { - - internal let description: ConstraintDescription - - internal init(_ description: ConstraintDescription) { - self.description = description - } - - @discardableResult - public func labeled(_ label: String) -> ConstraintMakerFinalizable { - self.description.label = label - return self - } - - public var constraint: Constraint { - return self.description.constraint! - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintMakerPriortizable.swift b/YTAnimationDemo/SnapKit/ConstraintMakerPriortizable.swift deleted file mode 100755 index 82a6de6..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintMakerPriortizable.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public class ConstraintMakerPriortizable: ConstraintMakerFinalizable { - - @discardableResult - public func priority(_ amount: ConstraintPriorityTarget) -> ConstraintMakerFinalizable { - self.description.priority = amount - return self - } - - @available(*, deprecated:3.0, message:"Use priority(_ amount: ConstraintPriorityTarget) instead.") - @discardableResult - public func priorityRequired() -> ConstraintMakerFinalizable { - return self.priority(1000) - } - - @available(*, deprecated:3.0, message:"Use priority(_ amount: ConstraintPriorityTarget) instead.") - @discardableResult - public func priorityHigh() -> ConstraintMakerFinalizable { - return self.priority(750) - } - - @available(*, deprecated:3.0, message:"Use priority(_ amount: ConstraintPriorityTarget) instead.") - @discardableResult - public func priorityMedium() -> ConstraintMakerFinalizable { - #if os(iOS) || os(tvOS) - return self.priority(500) - #else - return self.priority(501) - #endif - } - - @available(*, deprecated:3.0, message:"Use priority(_ amount: ConstraintPriorityTarget) instead.") - @discardableResult - public func priorityLow() -> ConstraintMakerFinalizable { - return self.priority(250) - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintMakerRelatable.swift b/YTAnimationDemo/SnapKit/ConstraintMakerRelatable.swift deleted file mode 100755 index 40a46fa..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintMakerRelatable.swift +++ /dev/null @@ -1,95 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public class ConstraintMakerRelatable { - - internal let description: ConstraintDescription - - internal init(_ description: ConstraintDescription) { - self.description = description - } - - internal func relatedTo(_ other: ConstraintRelatableTarget, relation: ConstraintRelation, file: String, line: UInt) -> ConstraintMakerEditable { - let related: ConstraintItem - let constant: ConstraintConstantTarget - - if let other = other as? ConstraintItem { - guard other.attributes == ConstraintAttributes.none || - other.attributes.layoutAttributes.count <= 1 || - other.attributes.layoutAttributes == self.description.attributes.layoutAttributes || - other.attributes == .edges && self.description.attributes == .margins || - other.attributes == .margins && self.description.attributes == .edges else { - fatalError("Cannot constraint to multiple non identical attributes. (\(file), \(line))"); - } - - related = other - constant = 0.0 - } else if let other = other as? ConstraintView { - related = ConstraintItem(target: other, attributes: ConstraintAttributes.none) - constant = 0.0 - } else if let other = other as? ConstraintConstantTarget { - related = ConstraintItem(target: nil, attributes: ConstraintAttributes.none) - constant = other - } else { - fatalError("Invalid constraint. (\(file), \(line))") - } - - let editable = ConstraintMakerEditable(self.description) - editable.description.sourceLocation = (file, line) - editable.description.relation = relation - editable.description.related = related - editable.description.constant = constant - return editable - } - - @discardableResult - public func equalTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { - return self.relatedTo(other, relation: .equal, file: file, line: line) - } - - @discardableResult - public func equalToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { - guard let other = self.description.view.superview else { - fatalError("Expected superview but found nil when attempting make constraint `equalToSuperview`.") - } - return self.relatedTo(other, relation: .equal, file: file, line: line) - } - - @discardableResult - public func lessThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { - return self.relatedTo(other, relation: .lessThanOrEqual, file: file, line: line) - } - - @discardableResult - public func greaterThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable { - return self.relatedTo(other, relation: .greaterThanOrEqual, file: file, line: line) - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintMultiplierTarget.swift b/YTAnimationDemo/SnapKit/ConstraintMultiplierTarget.swift deleted file mode 100755 index 6fecd33..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintMultiplierTarget.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public protocol ConstraintMultiplierTarget { - - var constraintMultiplierTargetValue: CGFloat { get } - -} - -extension Int: ConstraintMultiplierTarget { - - public var constraintMultiplierTargetValue: CGFloat { - return CGFloat(self) - } - -} - -extension UInt: ConstraintMultiplierTarget { - - public var constraintMultiplierTargetValue: CGFloat { - return CGFloat(self) - } - -} - -extension Float: ConstraintMultiplierTarget { - - public var constraintMultiplierTargetValue: CGFloat { - return CGFloat(self) - } - -} - -extension Double: ConstraintMultiplierTarget { - - public var constraintMultiplierTargetValue: CGFloat { - return CGFloat(self) - } - -} - -extension CGFloat: ConstraintMultiplierTarget { - - public var constraintMultiplierTargetValue: CGFloat { - return self - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintOffsetTarget.swift b/YTAnimationDemo/SnapKit/ConstraintOffsetTarget.swift deleted file mode 100755 index bd9e0a1..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintOffsetTarget.swift +++ /dev/null @@ -1,69 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public protocol ConstraintOffsetTarget: ConstraintConstantTarget { -} - -extension Int: ConstraintOffsetTarget { -} - -extension UInt: ConstraintOffsetTarget { -} - -extension Float: ConstraintOffsetTarget { -} - -extension Double: ConstraintOffsetTarget { -} - -extension CGFloat: ConstraintOffsetTarget { -} - -extension ConstraintOffsetTarget { - - internal var constraintOffsetTargetValue: CGFloat { - let offset: CGFloat - if let amount = self as? Float { - offset = CGFloat(amount) - } else if let amount = self as? Double { - offset = CGFloat(amount) - } else if let amount = self as? CGFloat { - offset = CGFloat(amount) - } else if let amount = self as? Int { - offset = CGFloat(amount) - } else if let amount = self as? UInt { - offset = CGFloat(amount) - } else { - offset = 0.0 - } - return offset - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintPriorityTarget.swift b/YTAnimationDemo/SnapKit/ConstraintPriorityTarget.swift deleted file mode 100755 index eb32f79..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintPriorityTarget.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public protocol ConstraintPriorityTarget { - - var constraintPriorityTargetValue: Float { get } - -} - -extension Int: ConstraintPriorityTarget { - - public var constraintPriorityTargetValue: Float { - return Float(self) - } - -} - -extension UInt: ConstraintPriorityTarget { - - public var constraintPriorityTargetValue: Float { - return Float(self) - } - -} - -extension Float: ConstraintPriorityTarget { - - public var constraintPriorityTargetValue: Float { - return self - } - -} - -extension Double: ConstraintPriorityTarget { - - public var constraintPriorityTargetValue: Float { - return Float(self) - } - -} - -extension CGFloat: ConstraintPriorityTarget { - - public var constraintPriorityTargetValue: Float { - return Float(self) - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintRelatableTarget.swift b/YTAnimationDemo/SnapKit/ConstraintRelatableTarget.swift deleted file mode 100755 index 4d1e37d..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintRelatableTarget.swift +++ /dev/null @@ -1,62 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public protocol ConstraintRelatableTarget { -} - -extension Int: ConstraintRelatableTarget { -} - -extension UInt: ConstraintRelatableTarget { -} - -extension Float: ConstraintRelatableTarget { -} - -extension Double: ConstraintRelatableTarget { -} - -extension CGFloat: ConstraintRelatableTarget { -} - -extension CGSize: ConstraintRelatableTarget { -} - -extension CGPoint: ConstraintRelatableTarget { -} - -extension ConstraintInsets: ConstraintRelatableTarget { -} - -extension ConstraintItem: ConstraintRelatableTarget { -} - -extension ConstraintView: ConstraintRelatableTarget { -} diff --git a/YTAnimationDemo/SnapKit/ConstraintRelation.swift b/YTAnimationDemo/SnapKit/ConstraintRelation.swift deleted file mode 100755 index 48afbfc..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintRelation.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -internal enum ConstraintRelation: Int { - case equal = 1 - case lessThanOrEqual - case greaterThanOrEqual - - internal var layoutRelation: NSLayoutRelation { - get { - switch(self) { - case .equal: - return .equal - case .lessThanOrEqual: - return .lessThanOrEqual - case .greaterThanOrEqual: - return .greaterThanOrEqual - } - } - } -} diff --git a/YTAnimationDemo/SnapKit/ConstraintView+Extensions.swift b/YTAnimationDemo/SnapKit/ConstraintView+Extensions.swift deleted file mode 100755 index 77afad9..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintView+Extensions.swift +++ /dev/null @@ -1,152 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public extension ConstraintView { - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_left: ConstraintItem { return self.snp.left } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_top: ConstraintItem { return self.snp.top } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_right: ConstraintItem { return self.snp.right } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_bottom: ConstraintItem { return self.snp.bottom } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_leading: ConstraintItem { return self.snp.leading } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_trailing: ConstraintItem { return self.snp.trailing } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_width: ConstraintItem { return self.snp.width } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_height: ConstraintItem { return self.snp.height } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_centerX: ConstraintItem { return self.snp.centerX } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_centerY: ConstraintItem { return self.snp.centerY } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_baseline: ConstraintItem { return self.snp.baseline } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, OSX 10.11, *) - public var snp_lastBaseline: ConstraintItem { return self.snp.lastBaseline } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, OSX 10.11, *) - public var snp_firstBaseline: ConstraintItem { return self.snp.firstBaseline } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_leftMargin: ConstraintItem { return self.snp.leftMargin } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_topMargin: ConstraintItem { return self.snp.topMargin } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_rightMargin: ConstraintItem { return self.snp.rightMargin } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_bottomMargin: ConstraintItem { return self.snp.bottomMargin } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_leadingMargin: ConstraintItem { return self.snp.leadingMargin } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_trailingMargin: ConstraintItem { return self.snp.trailingMargin } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_centerXWithinMargins: ConstraintItem { return self.snp.centerXWithinMargins } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_centerYWithinMargins: ConstraintItem { return self.snp.centerYWithinMargins } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_edges: ConstraintItem { return self.snp.edges } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_size: ConstraintItem { return self.snp.size } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public var snp_center: ConstraintItem { return self.snp.center } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_margins: ConstraintItem { return self.snp.margins } - - @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.") - @available(iOS 8.0, *) - public var snp_centerWithinMargins: ConstraintItem { return self.snp.centerWithinMargins } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public func snp_prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { - return self.snp.prepareConstraints(closure) - } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public func snp_makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { - self.snp.makeConstraints(closure) - } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public func snp_remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { - self.snp.remakeConstraints(closure) - } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public func snp_updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { - self.snp.updateConstraints(closure) - } - - @available(*, deprecated:3.0, message:"Use newer snp.* syntax.") - public func snp_removeConstraints() { - self.snp.removeConstraints() - } - - public var snp: ConstraintViewDSL { - return ConstraintViewDSL(view: self) - } - -} diff --git a/YTAnimationDemo/SnapKit/ConstraintView.swift b/YTAnimationDemo/SnapKit/ConstraintView.swift deleted file mode 100755 index 6ff8a76..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintView.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -#if os(iOS) || os(tvOS) - public typealias ConstraintView = UIView -#else - public typealias ConstraintView = NSView -#endif diff --git a/YTAnimationDemo/SnapKit/ConstraintViewDSL.swift b/YTAnimationDemo/SnapKit/ConstraintViewDSL.swift deleted file mode 100755 index 541d18b..0000000 --- a/YTAnimationDemo/SnapKit/ConstraintViewDSL.swift +++ /dev/null @@ -1,135 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public struct ConstraintViewDSL: ConstraintAttributesDSL { - - @discardableResult - public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { - return ConstraintMaker.prepareConstraints(view: self.view, closure: closure) - } - - public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { - ConstraintMaker.makeConstraints(view: self.view, closure: closure) - } - - public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { - ConstraintMaker.remakeConstraints(view: self.view, closure: closure) - } - - public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { - ConstraintMaker.updateConstraints(view: self.view, closure: closure) - } - - public func removeConstraints() { - ConstraintMaker.removeConstraints(view: self.view) - } - - - - public var contentHuggingHorizontalPriority: Float { - get { - return self.view.contentHuggingPriority(for: .horizontal) - } - set { - self.view.setContentHuggingPriority(newValue, for: .horizontal) - } - } - - public var contentHuggingVerticalPriority: Float { - get { - return self.view.contentHuggingPriority(for: .vertical) - } - set { - self.view.setContentHuggingPriority(newValue, for: .vertical) - } - } - - public var contentCompressionResistanceHorizontalPriority: Float { - get { - return self.view.contentCompressionResistancePriority(for: .horizontal) - } - set { - self.view.setContentHuggingPriority(newValue, for: .horizontal) - } - } - - public var contentCompressionResistanceVerticalPriority: Float { - get { - return self.view.contentCompressionResistancePriority(for: .vertical) - } - set { - self.view.setContentCompressionResistancePriority(newValue, for: .vertical) - } - } - - public var target: AnyObject? { - return self.view - } - - internal let view: ConstraintView - - internal init(view: ConstraintView) { - self.view = view - - } - - internal var constraints: [Constraint] { - return self.constraintsHashTable.allObjects - } - - internal func add(constraints: [Constraint]) { - let hashTable = self.constraintsHashTable - for constraint in constraints { - hashTable.add(constraint) - } - } - - internal func remove(constraints: [Constraint]) { - let hashTable = self.constraintsHashTable - for constraint in constraints { - hashTable.remove(constraint) - } - } - - private var constraintsHashTable: NSHashTable { - let constraints: NSHashTable - - if let existing = objc_getAssociatedObject(self.view, &constraintsKey) as? NSHashTable { - constraints = existing - } else { - constraints = NSHashTable() - objc_setAssociatedObject(self.view, &constraintsKey, constraints, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - return constraints - - } - -} -private var constraintsKey: UInt8 = 0 diff --git a/YTAnimationDemo/SnapKit/Debugging.swift b/YTAnimationDemo/SnapKit/Debugging.swift deleted file mode 100755 index fdc505d..0000000 --- a/YTAnimationDemo/SnapKit/Debugging.swift +++ /dev/null @@ -1,160 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - -public extension LayoutConstraint { - - override public var description: String { - var description = "<" - - description += descriptionForObject(self) - - if let firstItem = conditionalOptional(from: self.firstItem) { - description += " \(descriptionForObject(firstItem))" - } - - if self.firstAttribute != .notAnAttribute { - description += ".\(descriptionForAttribute(self.firstAttribute))" - } - - description += " \(descriptionForRelation(self.relation))" - - if let secondItem = self.secondItem { - description += " \(descriptionForObject(secondItem))" - } - - if self.secondAttribute != .notAnAttribute { - description += ".\(descriptionForAttribute(self.secondAttribute))" - } - - if self.multiplier != 1.0 { - description += " * \(self.multiplier)" - } - - if self.secondAttribute == .notAnAttribute { - description += " \(self.constant)" - } else { - if self.constant > 0.0 { - description += " + \(self.constant)" - } else if self.constant < 0.0 { - description += " - \(abs(self.constant))" - } - } - - if self.priority != 1000.0 { - description += " ^\(self.priority)" - } - - description += ">" - - return description - } - -} - -private func descriptionForRelation(_ relation: NSLayoutRelation) -> String { - switch relation { - case .equal: return "==" - case .greaterThanOrEqual: return ">=" - case .lessThanOrEqual: return "<=" - } -} - -private func descriptionForAttribute(_ attribute: NSLayoutAttribute) -> String { - #if os(iOS) || os(tvOS) - switch attribute { - case .notAnAttribute: return "notAnAttribute" - case .top: return "top" - case .left: return "left" - case .bottom: return "bottom" - case .right: return "right" - case .leading: return "leading" - case .trailing: return "trailing" - case .width: return "width" - case .height: return "height" - case .centerX: return "centerX" - case .centerY: return "centerY" - case .lastBaseline: return "lastBaseline" - case .firstBaseline: return "firstBaseline" - case .topMargin: return "topMargin" - case .leftMargin: return "leftMargin" - case .bottomMargin: return "bottomMargin" - case .rightMargin: return "rightMargin" - case .leadingMargin: return "leadingMargin" - case .trailingMargin: return "trailingMargin" - case .centerXWithinMargins: return "centerXWithinMargins" - case .centerYWithinMargins: return "centerYWithinMargins" - } - #else - switch attribute { - case .notAnAttribute: return "notAnAttribute" - case .top: return "top" - case .left: return "left" - case .bottom: return "bottom" - case .right: return "right" - case .leading: return "leading" - case .trailing: return "trailing" - case .width: return "width" - case .height: return "height" - case .centerX: return "centerX" - case .centerY: return "centerY" - case .lastBaseline: return "lastBaseline" - case .firstBaseline: return "firstBaseline" - } - #endif -} - -private func conditionalOptional(from object: Optional) -> Optional { - return object -} - -private func conditionalOptional(from object: T) -> Optional { - return Optional.some(object) -} - -private func descriptionForObject(_ object: AnyObject) -> String { - let pointerDescription = String(format: "%p", UInt(bitPattern: ObjectIdentifier(object))) - var desc = "" - - desc += type(of: object).description() - - if let object = object as? ConstraintView { - desc += ":\(object.snp.label() ?? pointerDescription)" - } else if let object = object as? LayoutConstraint { - desc += ":\(object.label ?? pointerDescription)" - } else { - desc += ":\(pointerDescription)" - } - - if let object = object as? LayoutConstraint, let file = object.constraint?.sourceLocation.0, let line = object.constraint?.sourceLocation.1 { - desc += "@\((file as NSString).lastPathComponent)#\(line)" - } - - desc += "" - return desc -} diff --git a/YTAnimationDemo/SnapKit/LayoutConstraint.swift b/YTAnimationDemo/SnapKit/LayoutConstraint.swift deleted file mode 100755 index 27c4105..0000000 --- a/YTAnimationDemo/SnapKit/LayoutConstraint.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#else - import AppKit -#endif - - -public class LayoutConstraint: NSLayoutConstraint { - - public var label: String? { - get { - return self.identifier - } - set { - self.identifier = newValue - } - } - - internal weak var constraint: Constraint? = nil - -} - -internal func ==(lhs: LayoutConstraint, rhs: LayoutConstraint) -> Bool { - guard lhs.firstItem === rhs.firstItem && - lhs.secondItem === rhs.secondItem && - lhs.firstAttribute == rhs.firstAttribute && - lhs.secondAttribute == rhs.secondAttribute && - lhs.relation == rhs.relation && - lhs.priority == rhs.priority && - lhs.multiplier == rhs.multiplier else { - return false - } - return true -} diff --git a/YTAnimationDemo/SnapKit/SnapKit.h b/YTAnimationDemo/SnapKit/SnapKit.h deleted file mode 100755 index 12075c8..0000000 --- a/YTAnimationDemo/SnapKit/SnapKit.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -FOUNDATION_EXPORT double SnapKitVersionNumber; -FOUNDATION_EXPORT const unsigned char SnapKitVersionString[]; \ No newline at end of file diff --git a/YTAnimationDemo/SnapKit/UILayoutSupport+Extensions.swift b/YTAnimationDemo/SnapKit/UILayoutSupport+Extensions.swift deleted file mode 100755 index cfbce2e..0000000 --- a/YTAnimationDemo/SnapKit/UILayoutSupport+Extensions.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// SnapKit -// -// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if os(iOS) || os(tvOS) - import UIKit -#endif - - -@available(iOS 8.0, *) -public extension ConstraintLayoutSupport { - - public var snp: ConstraintLayoutSupportDSL { - return ConstraintLayoutSupportDSL(support: self) - } - -} diff --git "a/YTAnimationDemo/\347\273\204\345\212\250\347\224\273/YTGroupAnimationViewController.swift" "b/YTAnimationDemo/\347\273\204\345\212\250\347\224\273/YTGroupAnimationViewController.swift" index 240881b..5cfa188 100644 --- "a/YTAnimationDemo/\347\273\204\345\212\250\347\224\273/YTGroupAnimationViewController.swift" +++ "b/YTAnimationDemo/\347\273\204\345\212\250\347\224\273/YTGroupAnimationViewController.swift" @@ -96,7 +96,7 @@ extension YTGroupAnimationViewController{ animation_Position.fromValue = CGPoint.init(x: margin_ViewMidPosition, y: kScreenH / 2) animation_Position.toValue = CGPoint.init(x: kScreenW / 2, y: kScreenH / 2) animation_Position.duration = 1.0 - animation_Position.fillMode = "forwards" //只在前台 + animation_Position.fillMode = CAMediaTimingFillMode.init(rawValue: "forwards") //只在前台 animation_Position.isRemovedOnCompletion = false //切出界面再回来动画不会停止 animation_Position.beginTime = currentTime view_Body.layer.add(animation_Position, forKey: "positionAnimation") @@ -105,7 +105,7 @@ extension YTGroupAnimationViewController{ animation_Scale.fromValue = NSNumber.init(value: 0.7) animation_Scale.toValue = NSNumber.init(value: 2.0) animation_Scale.duration = 1.0 - animation_Scale.fillMode = "forwards" + animation_Scale.fillMode = CAMediaTimingFillMode.init(rawValue: "forwards") animation_Scale.isRemovedOnCompletion = false animation_Scale.beginTime = currentTime + 1.0 view_Body.layer.add(animation_Scale, forKey: "scaleAnimation") @@ -113,7 +113,7 @@ extension YTGroupAnimationViewController{ let animation_Rotate = CABasicAnimation.init(keyPath: "transform.rotation") animation_Rotate.toValue = NSNumber.init(value: Double.pi * 4) animation_Rotate.duration = 1.0 - animation_Rotate.fillMode = "forwards" + animation_Rotate.fillMode = CAMediaTimingFillMode.init(rawValue: "forwards") animation_Rotate.isRemovedOnCompletion = false animation_Rotate.beginTime = currentTime + 2.0 view_Body.layer.add(animation_Rotate, forKey: "rotateAnimation") diff --git "a/YTAnimationDemo/\350\277\207\346\270\241\345\212\250\347\224\273/YTTransitionAnimationViewController.swift" "b/YTAnimationDemo/\350\277\207\346\270\241\345\212\250\347\224\273/YTTransitionAnimationViewController.swift" index 7583f22..ec3406a 100644 --- "a/YTAnimationDemo/\350\277\207\346\270\241\345\212\250\347\224\273/YTTransitionAnimationViewController.swift" +++ "b/YTAnimationDemo/\350\277\207\346\270\241\345\212\250\347\224\273/YTTransitionAnimationViewController.swift" @@ -134,7 +134,7 @@ extension YTTransitionAnimationViewController{ func fadeAnimation() { let animation_Fade = CATransition() - animation_Fade.type = "fade" + animation_Fade.type = .fade animation_Fade.duration = 1.0 view_Body.layer.add(animation_Fade, forKey: "fadeAnimation") } @@ -142,7 +142,7 @@ extension YTTransitionAnimationViewController{ func moveInAnimation() { let animation_MoveIn = CATransition() - animation_MoveIn.type = "moveIn" + animation_MoveIn.type = .moveIn animation_MoveIn.duration = 1.0 view_Body.layer.add(animation_MoveIn, forKey: "moveInAnimation") } @@ -150,8 +150,8 @@ extension YTTransitionAnimationViewController{ func pushAnimation() { let animation_Push = CATransition() - animation_Push.type = "push" - animation_Push.subtype = "fromRight" /* the legal values are `fromLeft', `fromRight', `fromTop' and`fromBottom'. */ + animation_Push.type = .push + animation_Push.subtype = .fromRight /* the legal values are `fromLeft', `fromRight', `fromTop' and`fromBottom'. */ animation_Push.duration = 1.0 view_Body.layer.add(animation_Push, forKey: "pushAnimation") } @@ -159,8 +159,8 @@ extension YTTransitionAnimationViewController{ func revealAnimation() { let animation_Reveal = CATransition() - animation_Reveal.type = "reveal" - animation_Reveal.subtype = "fromRight" + animation_Reveal.type = .reveal + animation_Reveal.subtype = .fromRight animation_Reveal.duration = 1.0 view_Body.layer.add(animation_Reveal, forKey: "revealAnimation") } @@ -168,8 +168,8 @@ extension YTTransitionAnimationViewController{ func cubeAnimation() { let animation_Cube = CATransition() - animation_Cube.type = "cube" - animation_Cube.subtype = "fromRight" + animation_Cube.type = CATransitionType.init(rawValue: "cube") + animation_Cube.subtype = .fromRight animation_Cube.duration = 1.0 view_Body.layer.add(animation_Cube, forKey: "cubeAnimation") } @@ -177,8 +177,8 @@ extension YTTransitionAnimationViewController{ func suckAnimation() { let animation_Suck = CATransition() - animation_Suck.type = "suckEffect" - animation_Suck.subtype = "fromRight" + animation_Suck.type = CATransitionType.init(rawValue: "suckEffect") + animation_Suck.subtype = .fromRight animation_Suck.duration = 1.0 view_Body.layer.add(animation_Suck, forKey: "suckAnimation") } @@ -186,8 +186,8 @@ extension YTTransitionAnimationViewController{ func oglFlipAnimation() { let animation_OglFlip = CATransition() - animation_OglFlip.type = "oglFlip" - animation_OglFlip.subtype = "fromRight" + animation_OglFlip.type = CATransitionType.init(rawValue: "oglFlip") + animation_OglFlip.subtype = .fromRight animation_OglFlip.duration = 1.0 view_Body.layer.add(animation_OglFlip, forKey: "oglFlipAnimation") } @@ -195,8 +195,8 @@ extension YTTransitionAnimationViewController{ func rippleAnimation() { let animation_Ripple = CATransition() - animation_Ripple.type = "rippleEffect" - animation_Ripple.subtype = "fromRight" + animation_Ripple.type = CATransitionType.init(rawValue: "rippleEffect") + animation_Ripple.subtype = .fromRight animation_Ripple.duration = 1.0 view_Body.layer.add(animation_Ripple, forKey: "rippleAnimation") } @@ -204,8 +204,8 @@ extension YTTransitionAnimationViewController{ func curlAnimation() { let animation_Curl = CATransition() - animation_Curl.type = "pageCurl" - animation_Curl.subtype = "fromRight" + animation_Curl.type = CATransitionType.init(rawValue: "pageCurl") + animation_Curl.subtype = .fromRight animation_Curl.duration = 1.0 view_Body.layer.add(animation_Curl, forKey: "curlAnimation") } @@ -213,8 +213,8 @@ extension YTTransitionAnimationViewController{ func unCurlAnimation() { let animation_UnCurl = CATransition() - animation_UnCurl.type = "pageUnCurl" - animation_UnCurl.subtype = "fromRight" + animation_UnCurl.type = CATransitionType.init(rawValue: "pageUnCurl") + animation_UnCurl.subtype = .fromRight animation_UnCurl.duration = 1.0 view_Body.layer.add(animation_UnCurl, forKey: "unCurlAnimation") } @@ -222,8 +222,8 @@ extension YTTransitionAnimationViewController{ func caOpenAnimation() { let animation_CaOpen = CATransition() - animation_CaOpen.type = "cameraIrisHollowOpen" - animation_CaOpen.subtype = "fromRight" + animation_CaOpen.type = CATransitionType.init(rawValue: "cameraIrisHollowOpen") + animation_CaOpen.subtype = .fromRight animation_CaOpen.duration = 1.0 view_Body.layer.add(animation_CaOpen, forKey: "caOpenAnimation") } @@ -231,8 +231,8 @@ extension YTTransitionAnimationViewController{ func caCloseAnimation() { let animation_CaClose = CATransition() - animation_CaClose.type = "cameraIrisHollowClose" - animation_CaClose.subtype = "fromRight" + animation_CaClose.type = CATransitionType.init(rawValue: "cameraIrisHollowClose") + animation_CaClose.subtype = .fromRight animation_CaClose.duration = 1.0 view_Body.layer.add(animation_CaClose, forKey: "caCloseAnimation") } diff --git "a/YTAnimationDemo/\351\241\271\347\233\256\346\241\210\344\276\213/YTCombinationAnimationViewController.swift" "b/YTAnimationDemo/\351\241\271\347\233\256\346\241\210\344\276\213/YTCombinationAnimationViewController.swift" index 3cfd5fe..aa10809 100644 --- "a/YTAnimationDemo/\351\241\271\347\233\256\346\241\210\344\276\213/YTCombinationAnimationViewController.swift" +++ "b/YTAnimationDemo/\351\241\271\347\233\256\346\241\210\344\276\213/YTCombinationAnimationViewController.swift" @@ -139,7 +139,7 @@ extension YTCombinationAnimationViewController{ return array_Btn } - func dingDingBtnClick(btn: UIButton) { + @objc func dingDingBtnClick(btn: UIButton) { print("点击了 \(btn.titleLabel?.text ?? "")") } @@ -165,7 +165,7 @@ extension YTCombinationAnimationViewController{ } } - func dianZanBtnClick(btn: MCFireworksButton) { + @objc func dianZanBtnClick(btn: MCFireworksButton) { btn.isSelected = !btn.isSelected @@ -225,7 +225,7 @@ extension YTCombinationAnimationViewController { animation.duration = 2 animation.fromValue = 0 animation.toValue = 1 - animation.fillMode = "forwards" + animation.fillMode = CAMediaTimingFillMode.init(rawValue: "forwards") animation.isRemovedOnCompletion = false layer.add(animation, forKey: "strokeEndAnimation") diff --git "a/YTAnimationDemo/\351\241\271\347\233\256\346\241\210\344\276\213/\350\277\233\345\272\246/YTProgressView.swift" "b/YTAnimationDemo/\351\241\271\347\233\256\346\241\210\344\276\213/\350\277\233\345\272\246/YTProgressView.swift" index 104f007..ca9327c 100644 --- "a/YTAnimationDemo/\351\241\271\347\233\256\346\241\210\344\276\213/\350\277\233\345\272\246/YTProgressView.swift" +++ "b/YTAnimationDemo/\351\241\271\347\233\256\346\241\210\344\276\213/\350\277\233\345\272\246/YTProgressView.swift" @@ -58,7 +58,7 @@ extension YTProgressView { animation.duration = CFTimeInterval(Double(progress) * 0.01) animation.fromValue = NSNumber.init(value: 0) animation.toValue = NSNumber.init(value: Double(progress) * 0.01) - animation.fillMode = "forwards" + animation.fillMode = CAMediaTimingFillMode.init(rawValue: "forwards") animation.isRemovedOnCompletion = false //完成后不删除动画 layer_MainPathLayer.add(animation, forKey: "strokeEndAnimation") @@ -73,7 +73,7 @@ extension YTProgressView { } - func progressLabelTimerAction() { + @objc func progressLabelTimerAction() { DispatchQueue.main.async { self.label_Progress.text = String(self.num_Progress) + "%" @@ -121,7 +121,7 @@ extension YTProgressView { //渐变色 layer_Gradient = CAGradientLayer() layer_Gradient.frame = CGRect.init(x: 0, y: 0, width: kScreenW, height: kScreenH) - layer_Gradient.type = "axial" //线性变化 默认目前只有这一个type + layer_Gradient.type = CAGradientLayerType.init(rawValue: "axial") //线性变化 默认目前只有这一个type layer_Gradient.colors = [UIColor.init(hex: 0xf31414).cgColor, UIColor.init(hex: 0xf27200).cgColor, UIColor.init(hex: 0xffff00).cgColor, UIColor.init(hex: 0x2bee22).cgColor, UIColor.init(hex: 0x32a7eb).cgColor] layer_Gradient.locations = [0, 0.3, 0.5, 0.7, 1] //每个渐变颜色的终止位置,这些值必须是递增的,数组的长度和colors的长度最好一致 //startPoint endPoint 分别表示渐变层的起始位置和终止位置,这两个点被定义在一个单元坐标空间,[0,0]表示左上角位置,[1,1]表示右下角位置,默认值分别是[.5,0] and [.5,1];