diff --git a/Anchorage.xcodeproj/project.pbxproj b/Anchorage.xcodeproj/project.pbxproj index 5ba68a7..80503e0 100644 --- a/Anchorage.xcodeproj/project.pbxproj +++ b/Anchorage.xcodeproj/project.pbxproj @@ -37,6 +37,9 @@ 3C2050B71D3B213B00995DF3 /* Anchorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2050B61D3B213B00995DF3 /* Anchorage.swift */; }; 7A39D6311EB53E1100BDE9C0 /* AnchorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A39D6301EB53E1100BDE9C0 /* AnchorageTests.swift */; }; 7A39D6331EB53E1100BDE9C0 /* Anchorage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C2050AB1D3B20FD00995DF3 /* Anchorage.framework */; }; + 7AA89727233059A6A2DE18DB /* Pods_AnchorageDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8F0389C6D00AEDCE0477A2E /* Pods_AnchorageDemo.framework */; }; + A16B0A3423D4C8BD1BBB5C64 /* Pods_AnchorageTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AC798BFFD09EBA92C1F6CB5 /* Pods_AnchorageTests_iOS.framework */; }; + A4EE0CC9D8D444A853E40CCE /* Pods_Anchorage_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C576489BB5930483BB9C4EE7 /* Pods_Anchorage_tvOS.framework */; }; BBE7C0D71FAB676F00DACD2D /* NSLayoutAnchor+MultiplierConstraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE7C0D51FAB65B900DACD2D /* NSLayoutAnchor+MultiplierConstraints.swift */; }; BBE7C0D81FAB677500DACD2D /* NSLayoutAnchor+MultiplierConstraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE7C0D51FAB65B900DACD2D /* NSLayoutAnchor+MultiplierConstraints.swift */; }; BBE7C0D91FAB677600DACD2D /* NSLayoutAnchor+MultiplierConstraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE7C0D51FAB65B900DACD2D /* NSLayoutAnchor+MultiplierConstraints.swift */; }; @@ -58,6 +61,7 @@ D469DCB81EB7AB2F000F3DDD /* AnchorGroupProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D469DCB61EB7A975000F3DDD /* AnchorGroupProvider.swift */; }; D469DCB91EB7AB2F000F3DDD /* Priority.swift in Sources */ = {isa = PBXBuildFile; fileRef = D469DCB41EB7A904000F3DDD /* Priority.swift */; }; F154629B1E56846200C3948D /* Anchorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2050B61D3B213B00995DF3 /* Anchorage.swift */; }; + F502D6B2BD9C979AA94E918A /* Pods_AnchorageTests_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D754D72F6462CE4D58FDCB1 /* Pods_AnchorageTests_macOS.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -92,6 +96,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 0CD5EE58281654FA6A928090 /* Pods-Anchorage-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Anchorage-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-Anchorage-tvOS/Pods-Anchorage-tvOS.debug.xcconfig"; sourceTree = ""; }; + 0D754D72F6462CE4D58FDCB1 /* Pods_AnchorageTests_macOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AnchorageTests_macOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2DBB2D441D99596100A1E94B /* RootViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = ""; }; 2DBB2D461D99597500A1E94B /* ToggleActiveHeightCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ToggleActiveHeightCell.swift; path = Cells/ToggleActiveHeightCell.swift; sourceTree = ""; }; 2DBB2D471D99597500A1E94B /* MinimumWidthViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MinimumWidthViewCell.swift; path = Cells/MinimumWidthViewCell.swift; sourceTree = ""; }; @@ -107,10 +113,19 @@ 3C2050AB1D3B20FD00995DF3 /* Anchorage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Anchorage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3C2050AF1D3B20FD00995DF3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3C2050B61D3B213B00995DF3 /* Anchorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Anchorage.swift; sourceTree = ""; }; + 4A621F436D7AC1F311660FAA /* Pods-AnchorageDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AnchorageDemo.debug.xcconfig"; path = "Target Support Files/Pods-AnchorageDemo/Pods-AnchorageDemo.debug.xcconfig"; sourceTree = ""; }; + 54C143946A2174E4D55E7431 /* Pods-AnchorageTests-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AnchorageTests-iOS.debug.xcconfig"; path = "Target Support Files/Pods-AnchorageTests-iOS/Pods-AnchorageTests-iOS.debug.xcconfig"; sourceTree = ""; }; + 6571D2D39B6C49930B877172 /* Pods-AnchorageDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AnchorageDemo.release.xcconfig"; path = "Target Support Files/Pods-AnchorageDemo/Pods-AnchorageDemo.release.xcconfig"; sourceTree = ""; }; 7A39D62E1EB53E1100BDE9C0 /* AnchorageTests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AnchorageTests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 7A39D6301EB53E1100BDE9C0 /* AnchorageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorageTests.swift; sourceTree = ""; }; 7A39D6321EB53E1100BDE9C0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 970CF4C3A04070F004E5B81F /* Pods-AnchorageTests-macOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AnchorageTests-macOS.release.xcconfig"; path = "Target Support Files/Pods-AnchorageTests-macOS/Pods-AnchorageTests-macOS.release.xcconfig"; sourceTree = ""; }; + 9AC798BFFD09EBA92C1F6CB5 /* Pods_AnchorageTests_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AnchorageTests_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A23C27A30C0A91E20C837E17 /* Pods-AnchorageTests-macOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AnchorageTests-macOS.debug.xcconfig"; path = "Target Support Files/Pods-AnchorageTests-macOS/Pods-AnchorageTests-macOS.debug.xcconfig"; sourceTree = ""; }; + ABA15247037482DE25BF1C14 /* Pods-Anchorage-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Anchorage-tvOS.release.xcconfig"; path = "Target Support Files/Pods-Anchorage-tvOS/Pods-Anchorage-tvOS.release.xcconfig"; sourceTree = ""; }; BBE7C0D51FAB65B900DACD2D /* NSLayoutAnchor+MultiplierConstraints.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSLayoutAnchor+MultiplierConstraints.swift"; sourceTree = ""; }; + C576489BB5930483BB9C4EE7 /* Pods_Anchorage_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Anchorage_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C9544E58395B197F69A49D22 /* Pods-AnchorageTests-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AnchorageTests-iOS.release.xcconfig"; path = "Target Support Files/Pods-AnchorageTests-iOS/Pods-AnchorageTests-iOS.release.xcconfig"; sourceTree = ""; }; CD6A0E671EB7CDEF00FFF5DB /* AnchorageTests-macOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AnchorageTests-macOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; CD6A0E771EB7CE3A00FFF5DB /* Anchorage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Anchorage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CD6A0E7F1EB7CE3A00FFF5DB /* Anchorage-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Anchorage-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -118,6 +133,7 @@ D401673E1EB7A58D0025DCA5 /* Compatability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Compatability.swift; sourceTree = ""; }; D469DCB41EB7A904000F3DDD /* Priority.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Priority.swift; sourceTree = ""; }; D469DCB61EB7A975000F3DDD /* AnchorGroupProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnchorGroupProvider.swift; sourceTree = ""; }; + D8F0389C6D00AEDCE0477A2E /* Pods_AnchorageDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AnchorageDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F15462921E56842400C3948D /* Anchorage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Anchorage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -126,6 +142,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 7AA89727233059A6A2DE18DB /* Pods_AnchorageDemo.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -141,6 +158,7 @@ buildActionMask = 2147483647; files = ( 7A39D6331EB53E1100BDE9C0 /* Anchorage.framework in Frameworks */, + A16B0A3423D4C8BD1BBB5C64 /* Pods_AnchorageTests_iOS.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -149,6 +167,7 @@ buildActionMask = 2147483647; files = ( CD6A0E6C1EB7CDEF00FFF5DB /* Anchorage.framework in Frameworks */, + F502D6B2BD9C979AA94E918A /* Pods_AnchorageTests_macOS.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -156,6 +175,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A4EE0CC9D8D444A853E40CCE /* Pods_Anchorage_tvOS.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -210,6 +230,8 @@ 2DD242691D95C2CE001D6725 /* AnchorageDemo */, 7A39D62F1EB53E1100BDE9C0 /* AnchorageTests */, 3C2050AC1D3B20FD00995DF3 /* Products */, + F2374A7C4BE588ED4BBA0B2F /* Pods */, + 981A190F6CEA17202ABA60AE /* Frameworks */, ); sourceTree = ""; }; @@ -251,6 +273,32 @@ path = AnchorageTests; sourceTree = ""; }; + 981A190F6CEA17202ABA60AE /* Frameworks */ = { + isa = PBXGroup; + children = ( + C576489BB5930483BB9C4EE7 /* Pods_Anchorage_tvOS.framework */, + D8F0389C6D00AEDCE0477A2E /* Pods_AnchorageDemo.framework */, + 9AC798BFFD09EBA92C1F6CB5 /* Pods_AnchorageTests_iOS.framework */, + 0D754D72F6462CE4D58FDCB1 /* Pods_AnchorageTests_macOS.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + F2374A7C4BE588ED4BBA0B2F /* Pods */ = { + isa = PBXGroup; + children = ( + 0CD5EE58281654FA6A928090 /* Pods-Anchorage-tvOS.debug.xcconfig */, + ABA15247037482DE25BF1C14 /* Pods-Anchorage-tvOS.release.xcconfig */, + 4A621F436D7AC1F311660FAA /* Pods-AnchorageDemo.debug.xcconfig */, + 6571D2D39B6C49930B877172 /* Pods-AnchorageDemo.release.xcconfig */, + 54C143946A2174E4D55E7431 /* Pods-AnchorageTests-iOS.debug.xcconfig */, + C9544E58395B197F69A49D22 /* Pods-AnchorageTests-iOS.release.xcconfig */, + A23C27A30C0A91E20C837E17 /* Pods-AnchorageTests-macOS.debug.xcconfig */, + 970CF4C3A04070F004E5B81F /* Pods-AnchorageTests-macOS.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -282,6 +330,7 @@ isa = PBXNativeTarget; buildConfigurationList = 2DD242721D95C2CE001D6725 /* Build configuration list for PBXNativeTarget "AnchorageDemo" */; buildPhases = ( + BB97F602967064214646D121 /* [CP] Check Pods Manifest.lock */, 2DD242641D95C2CE001D6725 /* Sources */, 2DD242651D95C2CE001D6725 /* Frameworks */, 2DD242661D95C2CE001D6725 /* Resources */, @@ -318,9 +367,11 @@ isa = PBXNativeTarget; buildConfigurationList = 7A39D6381EB53E1100BDE9C0 /* Build configuration list for PBXNativeTarget "AnchorageTests-iOS" */; buildPhases = ( + F9138B3D1790257E1E3B8AD5 /* [CP] Check Pods Manifest.lock */, 7A39D62A1EB53E1100BDE9C0 /* Sources */, 7A39D62B1EB53E1100BDE9C0 /* Frameworks */, 7A39D62C1EB53E1100BDE9C0 /* Resources */, + CE03B1BD28C524F42BDD2A3C /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -336,9 +387,11 @@ isa = PBXNativeTarget; buildConfigurationList = CD6A0E711EB7CDEF00FFF5DB /* Build configuration list for PBXNativeTarget "AnchorageTests-macOS" */; buildPhases = ( + 865C9976AA3925530AF989DF /* [CP] Check Pods Manifest.lock */, CD6A0E631EB7CDEF00FFF5DB /* Sources */, CD6A0E641EB7CDEF00FFF5DB /* Frameworks */, CD6A0E651EB7CDEF00FFF5DB /* Resources */, + 8840D05D022C42AE36163DD5 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -354,6 +407,7 @@ isa = PBXNativeTarget; buildConfigurationList = CD6A0E881EB7CE3A00FFF5DB /* Build configuration list for PBXNativeTarget "Anchorage-tvOS" */; buildPhases = ( + F8BD1FD2891DCAF1F6F63FD4 /* [CP] Check Pods Manifest.lock */, CD6A0E721EB7CE3A00FFF5DB /* Sources */, CD6A0E731EB7CE3A00FFF5DB /* Frameworks */, CD6A0E741EB7CE3A00FFF5DB /* Headers */, @@ -444,7 +498,6 @@ }; CD6A0E7E1EB7CE3A00FFF5DB = { CreatedOnToolsVersion = 8.3.2; - DevelopmentTeam = 336S848KQ4; ProvisioningStyle = Automatic; }; CD6A0E9B1EB7D36400FFF5DB = { @@ -539,6 +592,74 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 865C9976AA3925530AF989DF /* [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-AnchorageTests-macOS-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; + }; + 8840D05D022C42AE36163DD5 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-AnchorageTests-macOS/Pods-AnchorageTests-macOS-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/SnapshotTesting-macOS/SnapshotTesting.framework", + "${BUILT_PRODUCTS_DIR}/Then-macOS/Then.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + ); + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapshotTesting.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Then.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AnchorageTests-macOS/Pods-AnchorageTests-macOS-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + BB97F602967064214646D121 /* [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-AnchorageDemo-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; + }; CD6A0E9F1EB7D36A00FFF5DB /* Build and test iOS */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -595,6 +716,74 @@ shellPath = /bin/sh; shellScript = "xcodebuild build -project Anchorage.xcodeproj -scheme AnchorageDemo -sdk iphonesimulator -destination \"name=iPhone 6s\" SWIFT_VERSION=3.0 CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=\nxcodebuild build -project Anchorage.xcodeproj -scheme AnchorageDemo -sdk iphonesimulator -destination \"name=iPhone 6s\" SWIFT_VERSION=4.0 CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="; }; + CE03B1BD28C524F42BDD2A3C /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-AnchorageTests-iOS/Pods-AnchorageTests-iOS-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/SnapshotTesting-iOS/SnapshotTesting.framework", + "${BUILT_PRODUCTS_DIR}/Then-iOS/Then.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + ); + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapshotTesting.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Then.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AnchorageTests-iOS/Pods-AnchorageTests-iOS-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + F8BD1FD2891DCAF1F6F63FD4 /* [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-Anchorage-tvOS-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; + }; + F9138B3D1790257E1E3B8AD5 /* [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-AnchorageTests-iOS-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 */ @@ -715,6 +904,7 @@ /* Begin XCBuildConfiguration section */ 2DD242731D95C2CE001D6725 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 4A621F436D7AC1F311660FAA /* Pods-AnchorageDemo.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_WARN_INFINITE_RECURSION = YES; @@ -730,6 +920,7 @@ }; 2DD242741D95C2CE001D6725 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 6571D2D39B6C49930B877172 /* Pods-AnchorageDemo.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_WARN_INFINITE_RECURSION = YES; @@ -901,11 +1092,12 @@ }; 7A39D6361EB53E1100BDE9C0 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 54C143946A2174E4D55E7431 /* Pods-AnchorageTests-iOS.debug.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; DEVELOPMENT_TEAM = 2KJHM26Y46; INFOPLIST_FILE = AnchorageTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.$(PRODUCT_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -915,11 +1107,12 @@ }; 7A39D6371EB53E1100BDE9C0 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C9544E58395B197F69A49D22 /* Pods-AnchorageTests-iOS.release.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; DEVELOPMENT_TEAM = 2KJHM26Y46; INFOPLIST_FILE = AnchorageTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.$(PRODUCT_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -929,6 +1122,7 @@ }; CD6A0E6F1EB7CDEF00FFF5DB /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = A23C27A30C0A91E20C837E17 /* Pods-AnchorageTests-macOS.debug.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; COMBINE_HIDPI_IMAGES = YES; @@ -943,6 +1137,7 @@ }; CD6A0E701EB7CDEF00FFF5DB /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 970CF4C3A04070F004E5B81F /* Pods-AnchorageTests-macOS.release.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; COMBINE_HIDPI_IMAGES = YES; @@ -957,6 +1152,7 @@ }; CD6A0E891EB7CE3A00FFF5DB /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0CD5EE58281654FA6A928090 /* Pods-Anchorage-tvOS.debug.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = ""; @@ -979,6 +1175,7 @@ }; CD6A0E8A1EB7CE3A00FFF5DB /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = ABA15247037482DE25BF1C14 /* Pods-Anchorage-tvOS.release.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = ""; @@ -1004,13 +1201,16 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - DEVELOPMENT_TEAM = 336S848KQ4; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = AnchorageTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.$(PRODUCT_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Debug; }; @@ -1019,13 +1219,16 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - DEVELOPMENT_TEAM = 336S848KQ4; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = AnchorageTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.raizlabs.$(PRODUCT_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Release; }; diff --git a/AnchorageTests/AnchorageTests.swift b/AnchorageTests/AnchorageTests.swift index 2c540d1..932380d 100644 --- a/AnchorageTests/AnchorageTests.swift +++ b/AnchorageTests/AnchorageTests.swift @@ -13,13 +13,22 @@ #endif @testable import Anchorage +import SnapshotTesting +import Then import XCTest #if swift(>=4.0) public typealias ConstraintAttribute = NSLayoutConstraint.Attribute #else public typealias ConstraintAttribute = NSLayoutAttribute - func XCTAssertEqual(_ expression1: @autoclosure () throws -> T, _ expression2: @autoclosure () throws -> T, accuracy: T, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) where T : FloatingPoint { + func XCTAssertEqual( + _ expression1: @autoclosure () throws -> T, + _ expression2: @autoclosure () throws -> T, + accuracy: T, + _ message: @autoclosure () -> String = "", + file: StaticString = #file, + line: UInt = #line + ) where T : FloatingPoint { XCTAssertEqualWithAccuracy(expression1, expression2, accuracy: accuracy, message, file: file, line: line) } #endif @@ -59,10 +68,24 @@ let dEpsilon: Double = 0.00001 class AnchorageTests: XCTestCase { - let view1 = TestView() - let view2 = TestView() + let view1 = TestView().then { + $0.backgroundColor = .red + } + let view2 = TestView().then { + $0.backgroundColor = .blue + } - let window = TestWindow() + let window = TestWindow().then { + $0.backgroundColor = .yellow + $0.frame = .init( + origin: .zero, + size: .init( + width: 200, + height: 200 + ) + ) + $0.isHidden = false + } override func setUp() { #if os(macOS) @@ -74,6 +97,15 @@ class AnchorageTests: XCTestCase { #endif } + func testBasicEqualitySnapshot() { + view1.edgeAnchors == window.edgeAnchors + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testBasicEquality() { let constraint = view1.widthAnchor == view2.widthAnchor assertIdentical(constraint.firstItem, view1) @@ -87,6 +119,18 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testBasicLessThanSnapshot() { + view1.topAnchor == window.topAnchor + view1.leadingAnchor == window.leadingAnchor + view1.trailingAnchor == window.trailingAnchor + view1.bottomAnchor <= window.bottomAnchor + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testBasicLessThan() { let constraint = view1.widthAnchor <= view2.widthAnchor assertIdentical(constraint.firstItem, view1) @@ -100,6 +144,17 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testBasicGreaterThanSnapshot() { + view1.widthAnchor == 50 + view1.heightAnchor == 50 + view1.edgeAnchors >= window.edgeAnchors + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testBasicGreaterThan() { let constraint = view1.widthAnchor >= view2.widthAnchor assertIdentical(constraint.firstItem, view1) @@ -113,6 +168,20 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testEqualityWithOffsetSnapshot() { + view2.widthAnchor == 50 + view2.heightAnchor == 50 + view2.centerAnchors == window.centerAnchors + view1.widthAnchor == view2.widthAnchor + 50 + view1.heightAnchor == view2.heightAnchor + 50 + view1.centerAnchors == window.centerAnchors + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEqualityWithOffset() { let constraint = view1.widthAnchor == view2.widthAnchor + 10 assertIdentical(constraint.firstItem, view1) @@ -126,6 +195,20 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testEqualityWithMultiplierSnapshot() { + view2.widthAnchor == 50 + view2.heightAnchor == 50 + view2.centerAnchors == window.centerAnchors + view1.widthAnchor == view2.widthAnchor * 2 + view1.heightAnchor == view2.heightAnchor * 2 + view1.centerAnchors == window.centerAnchors + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEqualityWithMultiplier() { let constraint = view1.widthAnchor == view2.widthAnchor / 2 assertIdentical(constraint.firstItem, view1) @@ -139,6 +222,18 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testAxisAnchorEqualityWithMultiplierSnapshot() { + view1.topAnchor == window.topAnchor + view1.bottomAnchor == window.bottomAnchor + view1.leadingAnchor == window.leadingAnchor + view1.trailingAnchor == window.trailingAnchor * 0.5 + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testAxisAnchorEqualityWithMultiplier() { let constraint = view1.leadingAnchor == view2.trailingAnchor / 2 assertIdentical(constraint.firstItem, view1) @@ -165,6 +260,18 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testAxisAnchorEqualityWithOffsetAndMultiplierSnapshot() { + view1.topAnchor == window.topAnchor + view1.bottomAnchor == window.bottomAnchor + view1.leadingAnchor == window.leadingAnchor + view1.trailingAnchor == (window.trailingAnchor + 50) * 0.25 + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testAxisAnchorEqualityWithOffsetAndMultiplier() { let constraint = view1.trailingAnchor == (view2.centerXAnchor + 10) / 2 assertIdentical(constraint.firstItem, view1) @@ -178,6 +285,23 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .centerX) } + func testEqualityWithPriorityConstantSnapshot() { + view1.topAnchor == window.topAnchor + view1.leadingAnchor == window.leadingAnchor + view1.bottomAnchor == window.bottomAnchor + view1.widthAnchor == window.widthAnchor ~ .high + view2.topAnchor == window.topAnchor + view2.trailingAnchor == window.trailingAnchor + view2.bottomAnchor == window.bottomAnchor + view2.widthAnchor == window.widthAnchor ~ .low + view1.trailingAnchor == view2.leadingAnchor + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEqualityWithPriorityConstant() { let constraint = view1.widthAnchor == view2.widthAnchor ~ .high assertIdentical(constraint.firstItem, view1) @@ -191,6 +315,23 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testEqualityWithPriorityLiteralSnapshot() { + view1.topAnchor == window.topAnchor + view1.leadingAnchor == window.leadingAnchor + view1.bottomAnchor == window.bottomAnchor + view1.widthAnchor == window.widthAnchor ~ 750 + view2.topAnchor == window.topAnchor + view2.trailingAnchor == window.trailingAnchor + view2.bottomAnchor == window.bottomAnchor + view2.widthAnchor == window.widthAnchor ~ 250 + view1.trailingAnchor == view2.leadingAnchor + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEqualityWithPriorityLiteral() { let constraint = view1.widthAnchor == view2.widthAnchor ~ 750 assertIdentical(constraint.firstItem, view1) @@ -204,6 +345,23 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testEqualityWithPriorityConstantMathSnapshot() { + view1.topAnchor == window.topAnchor + view1.leadingAnchor == window.leadingAnchor + view1.bottomAnchor == window.bottomAnchor + view1.widthAnchor == window.widthAnchor ~ .high + view2.topAnchor == window.topAnchor + view2.trailingAnchor == window.trailingAnchor + view2.bottomAnchor == window.bottomAnchor + view2.widthAnchor == window.widthAnchor ~ .high - 1 + view1.trailingAnchor == view2.leadingAnchor + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEqualityWithPriorityConstantMath() { let constraint = view1.widthAnchor == view2.widthAnchor ~ .high - 1 assertIdentical(constraint.firstItem, view1) @@ -217,6 +375,23 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testEqualityWithPriorityLiteralMathSnapshot() { + view1.topAnchor == window.topAnchor + view1.leadingAnchor == window.leadingAnchor + view1.bottomAnchor == window.bottomAnchor + view1.widthAnchor == window.widthAnchor ~ .high + view2.topAnchor == window.topAnchor + view2.trailingAnchor == window.trailingAnchor + view2.bottomAnchor == window.bottomAnchor + view2.widthAnchor == window.widthAnchor ~ Priority(750 - 1) + view1.trailingAnchor == view2.leadingAnchor + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEqualityWithPriorityLiteralMath() { let constraint = view1.widthAnchor == view2.widthAnchor ~ Priority(750 - 1) assertIdentical(constraint.firstItem, view1) @@ -230,6 +405,23 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testEqualityWithOffsetAndPriorityMathSnapshot() { + view1.topAnchor == window.topAnchor + view1.leadingAnchor == window.leadingAnchor + view1.bottomAnchor == window.bottomAnchor + view1.widthAnchor == window.widthAnchor - 100 ~ .high + 1 + view2.topAnchor == window.topAnchor + view2.trailingAnchor == window.trailingAnchor + view2.bottomAnchor == window.bottomAnchor + view2.widthAnchor == window.widthAnchor ~ .high + view1.trailingAnchor == view2.leadingAnchor + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEqualityWithOffsetAndPriorityMath() { let constraint = view1.widthAnchor == view2.widthAnchor + 10 ~ .high - 1 assertIdentical(constraint.firstItem, view1) @@ -243,6 +435,23 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testEqualityWithOffsetAndMultiplierAndPriorityMathSnapshot() { + view1.topAnchor == window.topAnchor + view1.leadingAnchor == window.leadingAnchor + view1.bottomAnchor == window.bottomAnchor + view1.widthAnchor == (window.widthAnchor + 50) / 4 ~ .high + 1 + view2.topAnchor == window.topAnchor + view2.trailingAnchor == window.trailingAnchor + view2.bottomAnchor == window.bottomAnchor + view2.widthAnchor == window.widthAnchor ~ .high + view1.trailingAnchor == view2.leadingAnchor + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEqualityWithOffsetAndMultiplierAndPriorityMath() { let constraint = view1.widthAnchor == (view2.widthAnchor + 10) / 2 ~ .high - 1 assertIdentical(constraint.firstItem, view1) @@ -256,6 +465,20 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(constraint.secondAttribute, .width) } + func testCenterAnchorsSnapshot() { + view2.widthAnchor == 50 + view2.heightAnchor == 50 + view2.centerAnchors == window.centerAnchors + view1.widthAnchor == view2.widthAnchor * 2 + view1.heightAnchor == view2.heightAnchor * 2 + view1.centerAnchors == view2.centerAnchors + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testCenterAnchors() { let constraints = view1.centerAnchors == view2.centerAnchors @@ -282,6 +505,35 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(vertical.secondAttribute, .centerY) } + func testCenterAnchorsWithOffsetSnapshot() { + view2.widthAnchor == 50 + view2.heightAnchor == 50 + view2.centerAnchors == window.centerAnchors + view1.widthAnchor == view2.widthAnchor * 2 + view1.heightAnchor == view2.heightAnchor * 2 + view1.centerAnchors == view2.centerAnchors + 25 + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + + func testCenterAnchorsWithOffsetAndPrioritySnapshot() { + view2.widthAnchor == 50 + view2.heightAnchor == 50 + view2.centerAnchors == window.centerAnchors + view1.widthAnchor == view2.widthAnchor * 2 + view1.heightAnchor == view2.heightAnchor * 2 + view1.bottomAnchor == window.bottomAnchor ~ .low + view1.centerAnchors == view2.centerAnchors + 25 ~ .low + 1 + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testCenterAnchorsWithOffsetAndPriority() { let constraints = view1.centerAnchors == view2.centerAnchors + 10 ~ .high - 1 @@ -308,6 +560,16 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(vertical.secondAttribute, .centerY) } + func testHorizontalAnchorsSnapshot() { + view1.heightAnchor == 50 + view1.horizontalAnchors == window.horizontalAnchors + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testHorizontalAnchors() { let constraints = view1.horizontalAnchors == view2.horizontalAnchors + 10 ~ .high - 1 @@ -334,6 +596,16 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(trailing.secondAttribute, .trailing) } + func testVerticalAnchorsSnapshot() { + view1.widthAnchor == 50 + view1.verticalAnchors == window.verticalAnchors + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testVerticalAnchors() { let constraints = view1.verticalAnchors == view2.verticalAnchors + 10 ~ .high - 1 @@ -360,6 +632,15 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(bottom.secondAttribute, .bottom) } + func testSizeAnchorsSnapshot() { + view1.sizeAnchors == window.sizeAnchors + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testSizeAnchors() { let constraints = view1.sizeAnchors == view2.sizeAnchors + 10 ~ .high - 1 @@ -386,6 +667,15 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(height.secondAttribute, .height) } + func testSizeAnchorsWithConstantsSnapshot() { + view1.sizeAnchors == CGSize(width: 100, height: 100) + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testSizeAnchorsWithConstants() { let constraints = view1.sizeAnchors == CGSize(width: 50, height: 100) ~ .high - 1 @@ -412,6 +702,15 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(height.secondAttribute, .notAnAttribute) } + func testEdgeAnchorsSnapshot() { + view1.edgeAnchors == window.edgeAnchors + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEdgeAnchors() { let constraints = view1.edgeAnchors == view2.edgeAnchors + 10 ~ .high - 1 @@ -477,6 +776,15 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(bottom.secondAttribute, .bottom) } + func testEdgeAnchorsWithInsetsSnapshot() { + view1.edgeAnchors == window.edgeAnchors + 50 + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testEdgeAnchorsWithInsets() { let insets = EdgeInsets(top: 10, left: 5, bottom: 15, right: 20) @@ -527,6 +835,18 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(bottom.secondAttribute, .bottom) } + func testInactiveBatchConstraintsSnapshot() { + view1.sizeAnchors == window.sizeAnchors - 100 + _ = Anchorage.batch(active: false) { + view2.sizeAnchors == window.sizeAnchors + } + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testInactiveBatchConstraints() { let constraints = Anchorage.batch(active: false) { view1.widthAnchor == view2.widthAnchor @@ -557,6 +877,17 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(height.secondAttribute, .height) } + func testActiveBatchConstraintsSnapshot() { + _ = Anchorage.batch(active: true) { + view1.sizeAnchors == window.sizeAnchors - 100 + } + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testActiveBatchConstraints() { let constraints = Anchorage.batch { view1.widthAnchor == view2.widthAnchor @@ -586,7 +917,23 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(height.firstAttribute, .height) XCTAssertEqual(height.secondAttribute, .height) } - + + func testNestedBatchConstraintsSnapshots() { + _ = Anchorage.batch(active: true) { + view1.sizeAnchors == window.sizeAnchors - 100 + view1.centerAnchors == window.centerAnchors + _ = Anchorage.batch(active: true) { + view2.sizeAnchors == window.sizeAnchors - 150 + view2.centerAnchors == window.centerAnchors + } + } + assertSnapshot( + matching: window, + as: .image, + record: false + ) + } + func testNestedBatchConstraints() { var nestedConstraints: [NSLayoutConstraint] = [] let constraints = Anchorage.batch { @@ -596,11 +943,11 @@ class AnchorageTests: XCTestCase { } view1.leadingAnchor == view2.leadingAnchor } - + let width = constraints[0] let leading = constraints[1] let height = nestedConstraints[0] - + assertIdentical(width.firstItem, view1) assertIdentical(width.secondItem, view2) XCTAssertEqual(width.constant, 0, accuracy: cgEpsilon) @@ -610,7 +957,7 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(width.relation, .equal) XCTAssertEqual(width.firstAttribute, .width) XCTAssertEqual(width.secondAttribute, .width) - + assertIdentical(height.firstItem, view1) assertIdentical(height.secondItem, view2) XCTAssertEqual(height.constant, 0, accuracy: cgEpsilon) @@ -620,7 +967,7 @@ class AnchorageTests: XCTestCase { XCTAssertEqual(height.relation, .equal) XCTAssertEqual(height.firstAttribute, .height) XCTAssertEqual(height.secondAttribute, .height) - + assertIdentical(leading.firstItem, view1) assertIdentical(leading.secondItem, view2) XCTAssertEqual(leading.constant, 0, accuracy: cgEpsilon) diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/.DS_Store b/AnchorageTests/__Snapshots__/AnchorageTests/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/.DS_Store differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testActiveBatchConstraintsSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testActiveBatchConstraintsSnapshot.1.png new file mode 100644 index 0000000..da3988a Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testActiveBatchConstraintsSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testAxisAnchorEqualityWithMultiplierSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testAxisAnchorEqualityWithMultiplierSnapshot.1.png new file mode 100644 index 0000000..8121922 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testAxisAnchorEqualityWithMultiplierSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testAxisAnchorEqualityWithOffsetAndMultiplierSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testAxisAnchorEqualityWithOffsetAndMultiplierSnapshot.1.png new file mode 100644 index 0000000..8121922 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testAxisAnchorEqualityWithOffsetAndMultiplierSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testBasicEqualitySnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testBasicEqualitySnapshot.1.png new file mode 100644 index 0000000..215f3ee Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testBasicEqualitySnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testBasicGreaterThanSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testBasicGreaterThanSnapshot.1.png new file mode 100644 index 0000000..16d1164 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testBasicGreaterThanSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testBasicLessThanSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testBasicLessThanSnapshot.1.png new file mode 100644 index 0000000..08c3f48 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testBasicLessThanSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testCenterAnchorsSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testCenterAnchorsSnapshot.1.png new file mode 100644 index 0000000..3403543 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testCenterAnchorsSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testCenterAnchorsWithOffsetAndPrioritySnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testCenterAnchorsWithOffsetAndPrioritySnapshot.1.png new file mode 100644 index 0000000..fd6c7ed Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testCenterAnchorsWithOffsetAndPrioritySnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testCenterAnchorsWithOffsetSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testCenterAnchorsWithOffsetSnapshot.1.png new file mode 100644 index 0000000..fd6c7ed Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testCenterAnchorsWithOffsetSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEdgeAnchorsSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEdgeAnchorsSnapshot.1.png new file mode 100644 index 0000000..215f3ee Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEdgeAnchorsSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEdgeAnchorsWithInsetsSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEdgeAnchorsWithInsetsSnapshot.1.png new file mode 100644 index 0000000..8de57bc Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEdgeAnchorsWithInsetsSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithMultiplierSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithMultiplierSnapshot.1.png new file mode 100644 index 0000000..3403543 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithMultiplierSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithOffsetAndMultiplierAndPriorityMathSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithOffsetAndMultiplierAndPriorityMathSnapshot.1.png new file mode 100644 index 0000000..98ef3d4 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithOffsetAndMultiplierAndPriorityMathSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithOffsetAndPriorityMathSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithOffsetAndPriorityMathSnapshot.1.png new file mode 100644 index 0000000..98ef3d4 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithOffsetAndPriorityMathSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithOffsetSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithOffsetSnapshot.1.png new file mode 100644 index 0000000..3403543 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithOffsetSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityConstantMathSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityConstantMathSnapshot.1.png new file mode 100644 index 0000000..215f3ee Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityConstantMathSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityConstantSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityConstantSnapshot.1.png new file mode 100644 index 0000000..215f3ee Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityConstantSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityLiteralMathSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityLiteralMathSnapshot.1.png new file mode 100644 index 0000000..215f3ee Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityLiteralMathSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityLiteralSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityLiteralSnapshot.1.png new file mode 100644 index 0000000..215f3ee Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testEqualityWithPriorityLiteralSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testHorizontalAnchorsSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testHorizontalAnchorsSnapshot.1.png new file mode 100644 index 0000000..374cd3e Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testHorizontalAnchorsSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testInactiveBatchConstraintsSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testInactiveBatchConstraintsSnapshot.1.png new file mode 100644 index 0000000..da3988a Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testInactiveBatchConstraintsSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testNestedBatchConstraintsSnapshots.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testNestedBatchConstraintsSnapshots.1.png new file mode 100644 index 0000000..3403543 Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testNestedBatchConstraintsSnapshots.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testSizeAnchorsSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testSizeAnchorsSnapshot.1.png new file mode 100644 index 0000000..215f3ee Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testSizeAnchorsSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testSizeAnchorsWithConstantsSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testSizeAnchorsWithConstantsSnapshot.1.png new file mode 100644 index 0000000..da3988a Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testSizeAnchorsWithConstantsSnapshot.1.png differ diff --git a/AnchorageTests/__Snapshots__/AnchorageTests/testVerticalAnchorsSnapshot.1.png b/AnchorageTests/__Snapshots__/AnchorageTests/testVerticalAnchorsSnapshot.1.png new file mode 100644 index 0000000..238496f Binary files /dev/null and b/AnchorageTests/__Snapshots__/AnchorageTests/testVerticalAnchorsSnapshot.1.png differ diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..9340321 --- /dev/null +++ b/Podfile @@ -0,0 +1,27 @@ +# Uncomment the next line to define a global platform for your project + +target 'AnchorageTests-iOS' do + # Comment the next line if you're not using Swift and don't want to use dynamic frameworks + use_frameworks! + pod 'SnapshotTesting', '~> 1.1' + pod 'Then' +end + +target 'AnchorageTests-macOS' do + # Comment the next line if you're not using Swift and don't want to use dynamic frameworks + use_frameworks! + pod 'SnapshotTesting', '~> 1.1' + pod 'Then' +end + +target 'Anchorage-tvOS' do + # Comment the next line if you're not using Swift and don't want to use dynamic frameworks + use_frameworks! + pod 'SnapshotTesting', '~> 1.1' + pod 'Then' +end + +target 'AnchorageDemo' do + # Comment the next line if you're not using Swift and don't want to use dynamic frameworks + use_frameworks! +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..f27db4c --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,20 @@ +PODS: + - SnapshotTesting (1.1.0) + - Then (2.4.0) + +DEPENDENCIES: + - SnapshotTesting (~> 1.1) + - Then + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - SnapshotTesting + - Then + +SPEC CHECKSUMS: + SnapshotTesting: 8ed6a4dceee63f59a60e1bc86f9adbba54eb9287 + Then: 71866660c7af35a7343831f7668e7cd2b62ee0f2 + +PODFILE CHECKSUM: f0b6003146c0e1bda449be289c768e21c2b2f097 + +COCOAPODS: 1.6.0