- Upgrade Pod
- Add Phone Number validation
This commit is contained in:
parent
6300cbf9e5
commit
200b31d0a0
@ -7,7 +7,7 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
3D6443027611B8745FDF0B24 /* Pods_NSString_Helper_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DD359B387438B2D4450388A /* Pods_NSString_Helper_Tests.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
0D223AB6F02150A9ACBDBD94 /* Pods_NSString_Helper_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FE00DDFA05C08065E8026237 /* Pods_NSString_Helper_Example.framework */; };
|
||||||
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
|
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
|
||||||
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
|
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
|
||||||
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
|
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
|
||||||
@ -22,7 +22,7 @@
|
|||||||
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
|
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
|
||||||
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
|
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
|
||||||
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
|
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
|
||||||
C4EF5621F56130D055003559 /* Pods_NSString_Helper_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EFE0D4A13B53B7E05060D19 /* Pods_NSString_Helper_Example.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
FD5F03BF16688F5F84D6B2B4 /* Pods_NSString_Helper_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EEC7D25FF692DF5273E9910A /* Pods_NSString_Helper_Tests.framework */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@ -36,7 +36,8 @@
|
|||||||
/* End PBXContainerItemProxy section */
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
1DD359B387438B2D4450388A /* Pods_NSString_Helper_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NSString_Helper_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
2E9CEE81BD53F89DFA0781BE /* Pods-NSString-Helper_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NSString-Helper_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-NSString-Helper_Tests/Pods-NSString-Helper_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
412D7B9D1CA8644EED05E876 /* Pods-NSString-Helper_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NSString-Helper_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-NSString-Helper_Tests/Pods-NSString-Helper_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
6003F58A195388D20070C39A /* NSString-Helper_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "NSString-Helper_Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
6003F58A195388D20070C39A /* NSString-Helper_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "NSString-Helper_Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||||
6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||||
@ -57,14 +58,13 @@
|
|||||||
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
|
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
|
||||||
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
|
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
|
||||||
65AD924A02921B023EB2F1BC /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
65AD924A02921B023EB2F1BC /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
||||||
7EFE0D4A13B53B7E05060D19 /* Pods_NSString_Helper_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NSString_Helper_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
6831E237E4E7BCC8307EA49A /* Pods-NSString-Helper_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NSString-Helper_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-NSString-Helper_Example/Pods-NSString-Helper_Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
7A02A0538ECFE76907B78514 /* Pods-NSString-Helper_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NSString-Helper_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-NSString-Helper_Example/Pods-NSString-Helper_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
|
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
|
||||||
8F02B3F6151E5B6CD342FFDA /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
8F02B3F6151E5B6CD342FFDA /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||||
9D8D4A4795AC3BF9EBAF46B4 /* NSString-Helper.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = "NSString-Helper.podspec"; path = "../NSString-Helper.podspec"; sourceTree = "<group>"; };
|
9D8D4A4795AC3BF9EBAF46B4 /* NSString-Helper.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = "NSString-Helper.podspec"; path = "../NSString-Helper.podspec"; sourceTree = "<group>"; };
|
||||||
BA11FE2A2BFC85DEBC993892 /* Pods-NSString-Helper_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NSString-Helper_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-NSString-Helper_Tests/Pods-NSString-Helper_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
EEC7D25FF692DF5273E9910A /* Pods_NSString_Helper_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NSString_Helper_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
EC94CBC61626F76FC35C1843 /* Pods-NSString-Helper_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NSString-Helper_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-NSString-Helper_Example/Pods-NSString-Helper_Example.release.xcconfig"; sourceTree = "<group>"; };
|
FE00DDFA05C08065E8026237 /* Pods_NSString_Helper_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NSString_Helper_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
ED2EC77FB4990B89BA0547A1 /* Pods-NSString-Helper_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NSString-Helper_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-NSString-Helper_Tests/Pods-NSString-Helper_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
FFA33BFE170A44223EDC066D /* Pods-NSString-Helper_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NSString-Helper_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-NSString-Helper_Example/Pods-NSString-Helper_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@ -75,7 +75,7 @@
|
|||||||
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
|
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
|
||||||
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
|
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
|
||||||
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
|
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
|
||||||
C4EF5621F56130D055003559 /* Pods_NSString_Helper_Example.framework in Frameworks */,
|
0D223AB6F02150A9ACBDBD94 /* Pods_NSString_Helper_Example.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -86,7 +86,7 @@
|
|||||||
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
|
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
|
||||||
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
|
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
|
||||||
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
|
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
|
||||||
3D6443027611B8745FDF0B24 /* Pods_NSString_Helper_Tests.framework in Frameworks */,
|
FD5F03BF16688F5F84D6B2B4 /* Pods_NSString_Helper_Tests.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -101,7 +101,7 @@
|
|||||||
6003F5B5195388D20070C39A /* Tests */,
|
6003F5B5195388D20070C39A /* Tests */,
|
||||||
6003F58C195388D20070C39A /* Frameworks */,
|
6003F58C195388D20070C39A /* Frameworks */,
|
||||||
6003F58B195388D20070C39A /* Products */,
|
6003F58B195388D20070C39A /* Products */,
|
||||||
9D745FABDA1B8002D2C4DD40 /* Pods */,
|
BA7A5012B36E3C927058F0FC /* Pods */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@ -121,8 +121,8 @@
|
|||||||
6003F58F195388D20070C39A /* CoreGraphics.framework */,
|
6003F58F195388D20070C39A /* CoreGraphics.framework */,
|
||||||
6003F591195388D20070C39A /* UIKit.framework */,
|
6003F591195388D20070C39A /* UIKit.framework */,
|
||||||
6003F5AF195388D20070C39A /* XCTest.framework */,
|
6003F5AF195388D20070C39A /* XCTest.framework */,
|
||||||
7EFE0D4A13B53B7E05060D19 /* Pods_NSString_Helper_Example.framework */,
|
FE00DDFA05C08065E8026237 /* Pods_NSString_Helper_Example.framework */,
|
||||||
1DD359B387438B2D4450388A /* Pods_NSString_Helper_Tests.framework */,
|
EEC7D25FF692DF5273E9910A /* Pods_NSString_Helper_Tests.framework */,
|
||||||
);
|
);
|
||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -182,13 +182,13 @@
|
|||||||
name = "Podspec Metadata";
|
name = "Podspec Metadata";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
9D745FABDA1B8002D2C4DD40 /* Pods */ = {
|
BA7A5012B36E3C927058F0FC /* Pods */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
FFA33BFE170A44223EDC066D /* Pods-NSString-Helper_Example.debug.xcconfig */,
|
7A02A0538ECFE76907B78514 /* Pods-NSString-Helper_Example.debug.xcconfig */,
|
||||||
EC94CBC61626F76FC35C1843 /* Pods-NSString-Helper_Example.release.xcconfig */,
|
6831E237E4E7BCC8307EA49A /* Pods-NSString-Helper_Example.release.xcconfig */,
|
||||||
ED2EC77FB4990B89BA0547A1 /* Pods-NSString-Helper_Tests.debug.xcconfig */,
|
412D7B9D1CA8644EED05E876 /* Pods-NSString-Helper_Tests.debug.xcconfig */,
|
||||||
BA11FE2A2BFC85DEBC993892 /* Pods-NSString-Helper_Tests.release.xcconfig */,
|
2E9CEE81BD53F89DFA0781BE /* Pods-NSString-Helper_Tests.release.xcconfig */,
|
||||||
);
|
);
|
||||||
name = Pods;
|
name = Pods;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -200,12 +200,12 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "NSString-Helper_Example" */;
|
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "NSString-Helper_Example" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
A580F00E4077FC6A37D2C563 /* Check Pods Manifest.lock */,
|
C4D5E64415C6E6C3B486D1D2 /* Check Pods Manifest.lock */,
|
||||||
6003F586195388D20070C39A /* Sources */,
|
6003F586195388D20070C39A /* Sources */,
|
||||||
6003F587195388D20070C39A /* Frameworks */,
|
6003F587195388D20070C39A /* Frameworks */,
|
||||||
6003F588195388D20070C39A /* Resources */,
|
6003F588195388D20070C39A /* Resources */,
|
||||||
FD43EC67448708B5AA5C1CDD /* Embed Pods Frameworks */,
|
F4BFB45F0477AADDB169FF4A /* Embed Pods Frameworks */,
|
||||||
D3E048EBBCE8CBBD181E8D09 /* Copy Pods Resources */,
|
2FB602919CD9E6B1CC8177FF /* Copy Pods Resources */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@ -220,12 +220,12 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "NSString-Helper_Tests" */;
|
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "NSString-Helper_Tests" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
822B29FF17986217E104BE2A /* Check Pods Manifest.lock */,
|
3BAC6FE5CC3CFD00D5F15DAA /* Check Pods Manifest.lock */,
|
||||||
6003F5AA195388D20070C39A /* Sources */,
|
6003F5AA195388D20070C39A /* Sources */,
|
||||||
6003F5AB195388D20070C39A /* Frameworks */,
|
6003F5AB195388D20070C39A /* Frameworks */,
|
||||||
6003F5AC195388D20070C39A /* Resources */,
|
6003F5AC195388D20070C39A /* Resources */,
|
||||||
0891FF64D42060C0BC1673DE /* Embed Pods Frameworks */,
|
14C3CEC3CFF93DAD514DA1A7 /* Embed Pods Frameworks */,
|
||||||
AA5BFBF35997CC69A06C29F3 /* Copy Pods Resources */,
|
8C67E10569176F8352202CC1 /* Copy Pods Resources */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@ -293,7 +293,7 @@
|
|||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
0891FF64D42060C0BC1673DE /* Embed Pods Frameworks */ = {
|
14C3CEC3CFF93DAD514DA1A7 /* Embed Pods Frameworks */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
@ -308,52 +308,7 @@
|
|||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NSString-Helper_Tests/Pods-NSString-Helper_Tests-frameworks.sh\"\n";
|
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NSString-Helper_Tests/Pods-NSString-Helper_Tests-frameworks.sh\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
822B29FF17986217E104BE2A /* Check Pods Manifest.lock */ = {
|
2FB602919CD9E6B1CC8177FF /* Copy Pods Resources */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "Check Pods Manifest.lock";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
A580F00E4077FC6A37D2C563 /* Check Pods Manifest.lock */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "Check Pods Manifest.lock";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
AA5BFBF35997CC69A06C29F3 /* Copy Pods Resources */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "Copy Pods Resources";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NSString-Helper_Tests/Pods-NSString-Helper_Tests-resources.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
D3E048EBBCE8CBBD181E8D09 /* Copy Pods Resources */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
@ -368,7 +323,52 @@
|
|||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NSString-Helper_Example/Pods-NSString-Helper_Example-resources.sh\"\n";
|
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NSString-Helper_Example/Pods-NSString-Helper_Example-resources.sh\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
FD43EC67448708B5AA5C1CDD /* Embed Pods Frameworks */ = {
|
3BAC6FE5CC3CFD00D5F15DAA /* Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Check Pods Manifest.lock";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
8C67E10569176F8352202CC1 /* Copy Pods Resources */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Copy Pods Resources";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NSString-Helper_Tests/Pods-NSString-Helper_Tests-resources.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
C4D5E64415C6E6C3B486D1D2 /* Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Check Pods Manifest.lock";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
F4BFB45F0477AADDB169FF4A /* Embed Pods Frameworks */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
@ -466,7 +466,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
@ -499,7 +499,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
@ -508,7 +508,7 @@
|
|||||||
};
|
};
|
||||||
6003F5C0195388D20070C39A /* Debug */ = {
|
6003F5C0195388D20070C39A /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = FFA33BFE170A44223EDC066D /* Pods-NSString-Helper_Example.debug.xcconfig */;
|
baseConfigurationReference = 7A02A0538ECFE76907B78514 /* Pods-NSString-Helper_Example.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||||
@ -523,7 +523,7 @@
|
|||||||
};
|
};
|
||||||
6003F5C1195388D20070C39A /* Release */ = {
|
6003F5C1195388D20070C39A /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = EC94CBC61626F76FC35C1843 /* Pods-NSString-Helper_Example.release.xcconfig */;
|
baseConfigurationReference = 6831E237E4E7BCC8307EA49A /* Pods-NSString-Helper_Example.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||||
@ -538,7 +538,7 @@
|
|||||||
};
|
};
|
||||||
6003F5C3195388D20070C39A /* Debug */ = {
|
6003F5C3195388D20070C39A /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = ED2EC77FB4990B89BA0547A1 /* Pods-NSString-Helper_Tests.debug.xcconfig */;
|
baseConfigurationReference = 412D7B9D1CA8644EED05E876 /* Pods-NSString-Helper_Tests.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
@ -561,7 +561,7 @@
|
|||||||
};
|
};
|
||||||
6003F5C4195388D20070C39A /* Release */ = {
|
6003F5C4195388D20070C39A /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = BA11FE2A2BFC85DEBC993892 /* Pods-NSString-Helper_Tests.release.xcconfig */;
|
baseConfigurationReference = 2E9CEE81BD53F89DFA0781BE /* Pods-NSString-Helper_Tests.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
source 'https://github.com/CocoaPods/Specs.git'
|
source 'https://github.com/CocoaPods/Specs.git'
|
||||||
use_frameworks!
|
use_frameworks!
|
||||||
|
|
||||||
target 'NSString-Helper_Example', :exclusive => true do
|
target 'NSString-Helper_Example' do
|
||||||
pod "NSString-Helper", :path => "../"
|
pod "NSString-Helper", :path => "../"
|
||||||
end
|
end
|
||||||
|
|
||||||
target 'NSString-Helper_Tests', :exclusive => true do
|
target 'NSString-Helper_Tests' do
|
||||||
pod "NSString-Helper", :path => "../"
|
pod "NSString-Helper", :path => "../"
|
||||||
|
|
||||||
pod 'FBSnapshotTestCase'
|
pod 'FBSnapshotTestCase'
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- FBSnapshotTestCase (2.0.2):
|
- FBSnapshotTestCase (2.0.7):
|
||||||
- FBSnapshotTestCase/SwiftSupport (= 2.0.2)
|
- FBSnapshotTestCase/SwiftSupport (= 2.0.7)
|
||||||
- FBSnapshotTestCase/Core (2.0.2)
|
- FBSnapshotTestCase/Core (2.0.7)
|
||||||
- FBSnapshotTestCase/SwiftSupport (2.0.2):
|
- FBSnapshotTestCase/SwiftSupport (2.0.7):
|
||||||
- FBSnapshotTestCase/Core
|
- FBSnapshotTestCase/Core
|
||||||
- NSString-Helper (0.1.0)
|
- NSString-Helper (1.0.2)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- FBSnapshotTestCase
|
- FBSnapshotTestCase
|
||||||
@ -12,10 +12,12 @@ DEPENDENCIES:
|
|||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
NSString-Helper:
|
NSString-Helper:
|
||||||
:path: ../
|
:path: "../"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
FBSnapshotTestCase: fd500d5b282c4ec60215d26d0b58b0cf271dd0d6
|
FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
|
||||||
NSString-Helper: 9b95cbcfebaf8aae322a0c9018bcbf97dec93167
|
NSString-Helper: 0ee74919829a332f9838fa87b28cb2d1d991e92c
|
||||||
|
|
||||||
COCOAPODS: 0.37.2
|
PODFILE CHECKSUM: a88b2ea7b96d7de499d212328481d74fcf022692
|
||||||
|
|
||||||
|
COCOAPODS: 1.0.0.beta.2
|
||||||
|
|||||||
15
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase.modulemap
generated
Normal file
15
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase.modulemap
generated
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
framework module FBSnapshotTestCase {
|
||||||
|
umbrella header "FBSnapshotTestCase.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
|
||||||
|
header "FBSnapshotTestCase.h"
|
||||||
|
header "FBSnapshotTestCasePlatform.h"
|
||||||
|
header "FBSnapshotTestController.h"
|
||||||
|
|
||||||
|
private header "UIImage+Compare.h"
|
||||||
|
private header "UIImage+Diff.h"
|
||||||
|
private header "UIImage+Snapshot.h"
|
||||||
|
}
|
||||||
|
|
||||||
@ -32,6 +32,6 @@
|
|||||||
|
|
||||||
@interface UIImage (Compare)
|
@interface UIImage (Compare)
|
||||||
|
|
||||||
- (BOOL)compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance;
|
- (BOOL)fb_compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@ -28,7 +28,7 @@
|
|||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "UIImage+Compare.h"
|
#import <FBSnapshotTestCase/UIImage+Compare.h>
|
||||||
|
|
||||||
// This makes debugging much more fun
|
// This makes debugging much more fun
|
||||||
typedef union {
|
typedef union {
|
||||||
@ -44,7 +44,7 @@ typedef union {
|
|||||||
|
|
||||||
@implementation UIImage (Compare)
|
@implementation UIImage (Compare)
|
||||||
|
|
||||||
- (BOOL)compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance
|
- (BOOL)fb_compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance
|
||||||
{
|
{
|
||||||
NSAssert(CGSizeEqualToSize(self.size, image.size), @"Images must be same size.");
|
NSAssert(CGSizeEqualToSize(self.size, image.size), @"Images must be same size.");
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ typedef union {
|
|||||||
imageEqual = (memcmp(referenceImagePixels, imagePixels, referenceImageSizeBytes) == 0);
|
imageEqual = (memcmp(referenceImagePixels, imagePixels, referenceImageSizeBytes) == 0);
|
||||||
} else {
|
} else {
|
||||||
// Go through each pixel in turn and see if it is different
|
// Go through each pixel in turn and see if it is different
|
||||||
const NSInteger pixelCount = self.size.width * self.size.height;
|
const NSInteger pixelCount = referenceImageSize.width * referenceImageSize.height;
|
||||||
|
|
||||||
FBComparePixel *p1 = referenceImagePixels;
|
FBComparePixel *p1 = referenceImagePixels;
|
||||||
FBComparePixel *p2 = imagePixels;
|
FBComparePixel *p2 = imagePixels;
|
||||||
@ -32,6 +32,6 @@
|
|||||||
|
|
||||||
@interface UIImage (Diff)
|
@interface UIImage (Diff)
|
||||||
|
|
||||||
- (UIImage *)diffWithImage:(UIImage *)image;
|
- (UIImage *)fb_diffWithImage:(UIImage *)image;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@ -28,11 +28,11 @@
|
|||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "UIImage+Diff.h"
|
#import <FBSnapshotTestCase/UIImage+Diff.h>
|
||||||
|
|
||||||
@implementation UIImage (Diff)
|
@implementation UIImage (Diff)
|
||||||
|
|
||||||
- (UIImage *)diffWithImage:(UIImage *)image
|
- (UIImage *)fb_diffWithImage:(UIImage *)image
|
||||||
{
|
{
|
||||||
if (!image) {
|
if (!image) {
|
||||||
return nil;
|
return nil;
|
||||||
24
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.h
generated
Normal file
24
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.h
generated
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD-style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
@interface UIImage (Snapshot)
|
||||||
|
|
||||||
|
/// Uses renderInContext: to get a snapshot of the layer.
|
||||||
|
+ (UIImage *)fb_imageForLayer:(CALayer *)layer;
|
||||||
|
|
||||||
|
/// Uses renderInContext: to get a snapshot of the view layer.
|
||||||
|
+ (UIImage *)fb_imageForViewLayer:(UIView *)view;
|
||||||
|
|
||||||
|
/// Uses drawViewHierarchyInRect: to get a snapshot of the view and adds the view into a window if needed.
|
||||||
|
+ (UIImage *)fb_imageForView:(UIView *)view;
|
||||||
|
|
||||||
|
@end
|
||||||
62
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.m
generated
Normal file
62
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.m
generated
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD-style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <FBSnapshotTestCase/UIImage+Snapshot.h>
|
||||||
|
|
||||||
|
@implementation UIImage (Snapshot)
|
||||||
|
|
||||||
|
+ (UIImage *)fb_imageForLayer:(CALayer *)layer
|
||||||
|
{
|
||||||
|
CGRect bounds = layer.bounds;
|
||||||
|
NSAssert1(CGRectGetWidth(bounds), @"Zero width for layer %@", layer);
|
||||||
|
NSAssert1(CGRectGetHeight(bounds), @"Zero height for layer %@", layer);
|
||||||
|
|
||||||
|
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
|
||||||
|
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||||
|
NSAssert1(context, @"Could not generate context for layer %@", layer);
|
||||||
|
CGContextSaveGState(context);
|
||||||
|
[layer layoutIfNeeded];
|
||||||
|
[layer renderInContext:context];
|
||||||
|
CGContextRestoreGState(context);
|
||||||
|
|
||||||
|
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
|
||||||
|
UIGraphicsEndImageContext();
|
||||||
|
return snapshot;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (UIImage *)fb_imageForViewLayer:(UIView *)view
|
||||||
|
{
|
||||||
|
[view layoutIfNeeded];
|
||||||
|
return [self fb_imageForLayer:view.layer];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (UIImage *)fb_imageForView:(UIView *)view
|
||||||
|
{
|
||||||
|
CGRect bounds = view.bounds;
|
||||||
|
NSAssert1(CGRectGetWidth(bounds), @"Zero width for view %@", view);
|
||||||
|
NSAssert1(CGRectGetHeight(bounds), @"Zero height for view %@", view);
|
||||||
|
|
||||||
|
UIWindow *window = view.window;
|
||||||
|
if (window == nil) {
|
||||||
|
window = [[UIWindow alloc] initWithFrame:bounds];
|
||||||
|
[window addSubview:view];
|
||||||
|
[window makeKeyAndVisible];
|
||||||
|
}
|
||||||
|
|
||||||
|
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
|
||||||
|
[view layoutIfNeeded];
|
||||||
|
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
|
||||||
|
|
||||||
|
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
|
||||||
|
UIGraphicsEndImageContext();
|
||||||
|
return snapshot;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013, Facebook, Inc.
|
* Copyright (c) 2015, Facebook, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the BSD-style license found in the
|
||||||
@ -16,6 +16,21 @@
|
|||||||
|
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
There are three ways of setting reference image directories.
|
||||||
|
|
||||||
|
1. Set the preprocessor macro FB_REFERENCE_IMAGE_DIR to a double quoted
|
||||||
|
c-string with the path.
|
||||||
|
2. Set an environment variable named FB_REFERENCE_IMAGE_DIR with the path. This
|
||||||
|
takes precedence over the preprocessor macro to allow for run-time override.
|
||||||
|
3. Keep everything unset, which will cause the reference images to be looked up
|
||||||
|
inside the bundle holding the current test, in the
|
||||||
|
Resources/ReferenceImages_* directories.
|
||||||
|
*/
|
||||||
|
#ifndef FB_REFERENCE_IMAGE_DIR
|
||||||
|
#define FB_REFERENCE_IMAGE_DIR ""
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though.
|
Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though.
|
||||||
@param view The view to snapshot
|
@param view The view to snapshot
|
||||||
@ -24,25 +39,11 @@
|
|||||||
@param tolerance The percentage of pixels that can differ and still count as an 'identical' view
|
@param tolerance The percentage of pixels that can differ and still count as an 'identical' view
|
||||||
*/
|
*/
|
||||||
#define FBSnapshotVerifyViewWithOptions(view__, identifier__, suffixes__, tolerance__) \
|
#define FBSnapshotVerifyViewWithOptions(view__, identifier__, suffixes__, tolerance__) \
|
||||||
{ \
|
FBSnapshotVerifyViewOrLayerWithOptions(View, view__, identifier__, suffixes__, tolerance__)
|
||||||
NSString *envReferenceImageDirectory = [NSProcessInfo processInfo].environment[@"FB_REFERENCE_IMAGE_DIR"]; \
|
|
||||||
NSError *error__ = nil; \
|
|
||||||
BOOL comparisonSuccess__; \
|
|
||||||
XCTAssertTrue((suffixes__.count > 0), @"Suffixes set cannot be empty %@", suffixes__); \
|
|
||||||
XCTAssertNotNil(envReferenceImageDirectory, @"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.");\
|
|
||||||
for (NSString *suffix__ in suffixes__) { \
|
|
||||||
NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", envReferenceImageDirectory, suffix__]; \
|
|
||||||
comparisonSuccess__ = [self compareSnapshotOfView:(view__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \
|
|
||||||
if (comparisonSuccess__ || self.recordMode) break; \
|
|
||||||
} \
|
|
||||||
XCTAssertTrue(comparisonSuccess__, @"Snapshot comparison failed: %@", error__); \
|
|
||||||
XCTAssertFalse(self.recordMode, @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!"); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define FBSnapshotVerifyView(view__, identifier__) \
|
#define FBSnapshotVerifyView(view__, identifier__) \
|
||||||
{ \
|
FBSnapshotVerifyViewWithOptions(view__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0)
|
||||||
FBSnapshotVerifyViewWithOptions(view__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0); \
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though.
|
Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though.
|
||||||
@ -52,25 +53,53 @@ FBSnapshotVerifyViewWithOptions(view__, identifier__, FBSnapshotTestCaseDefaultS
|
|||||||
@param tolerance The percentage of pixels that can differ and still count as an 'identical' layer
|
@param tolerance The percentage of pixels that can differ and still count as an 'identical' layer
|
||||||
*/
|
*/
|
||||||
#define FBSnapshotVerifyLayerWithOptions(layer__, identifier__, suffixes__, tolerance__) \
|
#define FBSnapshotVerifyLayerWithOptions(layer__, identifier__, suffixes__, tolerance__) \
|
||||||
|
FBSnapshotVerifyViewOrLayerWithOptions(Layer, layer__, identifier__, suffixes__, tolerance__)
|
||||||
|
|
||||||
|
#define FBSnapshotVerifyLayer(layer__, identifier__) \
|
||||||
|
FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0)
|
||||||
|
|
||||||
|
|
||||||
|
#define FBSnapshotVerifyViewOrLayerWithOptions(what__, viewOrLayer__, identifier__, suffixes__, tolerance__) \
|
||||||
{ \
|
{ \
|
||||||
NSString *envReferenceImageDirectory = [NSProcessInfo processInfo].environment[@"FB_REFERENCE_IMAGE_DIR"]; \
|
NSString *referenceImageDirectory = [self getReferenceImageDirectoryWithDefault:(@ FB_REFERENCE_IMAGE_DIR)]; \
|
||||||
NSError *error__ = nil; \
|
XCTAssertNotNil(referenceImageDirectory, @"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.");\
|
||||||
BOOL comparisonSuccess__; \
|
|
||||||
XCTAssertTrue((suffixes__.count > 0), @"Suffixes set cannot be empty %@", suffixes__); \
|
XCTAssertTrue((suffixes__.count > 0), @"Suffixes set cannot be empty %@", suffixes__); \
|
||||||
XCTAssertNotNil(envReferenceImageDirectory, @"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.");\
|
\
|
||||||
for (NSString *suffix__ in suffixes__) { \
|
BOOL testSuccess__ = NO; \
|
||||||
NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", envReferenceImageDirectory, suffix__]; \
|
NSError *error__ = nil; \
|
||||||
comparisonSuccess__ = [self compareSnapshotOfLayer:(layer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \
|
NSMutableArray *errors__ = [NSMutableArray array]; \
|
||||||
if (comparisonSuccess__ || self.recordMode) break; \
|
\
|
||||||
|
if (self.recordMode) { \
|
||||||
|
\
|
||||||
|
NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", referenceImageDirectory, suffixes__.firstObject]; \
|
||||||
|
BOOL referenceImageSaved__ = [self compareSnapshotOf ## what__ :(viewOrLayer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \
|
||||||
|
if (!referenceImageSaved__) { \
|
||||||
|
[errors__ addObject:error__]; \
|
||||||
} \
|
} \
|
||||||
XCTAssertTrue(comparisonSuccess__, @"Snapshot comparison failed: %@", error__); \
|
} else { \
|
||||||
|
\
|
||||||
|
for (NSString *suffix__ in suffixes__) { \
|
||||||
|
NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", referenceImageDirectory, suffix__]; \
|
||||||
|
BOOL referenceImageAvailable = [self referenceImageRecordedInDirectory:referenceImagesDirectory__ identifier:(identifier__) error:&error__]; \
|
||||||
|
\
|
||||||
|
if (referenceImageAvailable) { \
|
||||||
|
BOOL comparisonSuccess__ = [self compareSnapshotOf ## what__ :(viewOrLayer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \
|
||||||
|
[errors__ removeAllObjects]; \
|
||||||
|
if (comparisonSuccess__) { \
|
||||||
|
testSuccess__ = YES; \
|
||||||
|
break; \
|
||||||
|
} else { \
|
||||||
|
[errors__ addObject:error__]; \
|
||||||
|
} \
|
||||||
|
} else { \
|
||||||
|
[errors__ addObject:error__]; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
XCTAssertTrue(testSuccess__, @"Snapshot comparison failed: %@", errors__.firstObject); \
|
||||||
XCTAssertFalse(self.recordMode, @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!"); \
|
XCTAssertFalse(self.recordMode, @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!"); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FBSnapshotVerifyLayer(layer__, identifier__) \
|
|
||||||
{ \
|
|
||||||
FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0); \
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The base class of view snapshotting tests. If you have small UI component, it's often easier to configure it in a test
|
The base class of view snapshotting tests. If you have small UI component, it's often easier to configure it in a test
|
||||||
@ -78,6 +107,10 @@ FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaul
|
|||||||
|
|
||||||
In order to flip the tests in your subclass to record the reference images set @c recordMode to @c YES.
|
In order to flip the tests in your subclass to record the reference images set @c recordMode to @c YES.
|
||||||
|
|
||||||
|
@attention When recording, the reference image directory should be explicitly
|
||||||
|
set, otherwise the images may be written to somewhere inside the
|
||||||
|
simulator directory.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
@code
|
@code
|
||||||
- (void)setUp
|
- (void)setUp
|
||||||
@ -94,6 +127,26 @@ FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaul
|
|||||||
*/
|
*/
|
||||||
@property (readwrite, nonatomic, assign) BOOL recordMode;
|
@property (readwrite, nonatomic, assign) BOOL recordMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
When @c YES appends the name of the device model and OS to the snapshot file name.
|
||||||
|
The default value is @c NO.
|
||||||
|
*/
|
||||||
|
@property (readwrite, nonatomic, assign, getter=isDeviceAgnostic) BOOL deviceAgnostic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
When YES, renders a snapshot of the complete view hierarchy as visible onscreen.
|
||||||
|
There are several things that do not work if renderInContext: is used.
|
||||||
|
- UIVisualEffect #70
|
||||||
|
- UIAppearance #91
|
||||||
|
- Size Classes #92
|
||||||
|
|
||||||
|
@attention If the view does't belong to a UIWindow, it will create one and add the view as a subview.
|
||||||
|
*/
|
||||||
|
@property (readwrite, nonatomic, assign) BOOL usesDrawViewHierarchyInRect;
|
||||||
|
|
||||||
|
- (void)setUp NS_REQUIRES_SUPER;
|
||||||
|
- (void)tearDown NS_REQUIRES_SUPER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Performs the comparison or records a snapshot of the layer if recordMode is YES.
|
Performs the comparison or records a snapshot of the layer if recordMode is YES.
|
||||||
@param layer The Layer to snapshot
|
@param layer The Layer to snapshot
|
||||||
@ -124,4 +177,24 @@ FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaul
|
|||||||
tolerance:(CGFloat)tolerance
|
tolerance:(CGFloat)tolerance
|
||||||
error:(NSError **)errorPtr;
|
error:(NSError **)errorPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Checks if reference image with identifier based name exists in the reference images directory.
|
||||||
|
@param referenceImagesDirectory The directory in which reference images are stored.
|
||||||
|
@param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method.
|
||||||
|
@param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
|
||||||
|
@returns YES if reference image exists.
|
||||||
|
*/
|
||||||
|
- (BOOL)referenceImageRecordedInDirectory:(NSString *)referenceImagesDirectory
|
||||||
|
identifier:(NSString *)identifier
|
||||||
|
error:(NSError **)errorPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the reference image directory.
|
||||||
|
|
||||||
|
Helper function used to implement the assert macros.
|
||||||
|
|
||||||
|
@param dir directory to use if environment variable not specified. Ignored if null or empty.
|
||||||
|
*/
|
||||||
|
- (NSString *)getReferenceImageDirectoryWithDefault:(NSString *)dir;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013, Facebook, Inc.
|
* Copyright (c) 2015, Facebook, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the BSD-style license found in the
|
||||||
@ -8,15 +8,16 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "FBSnapshotTestCase.h"
|
#import <FBSnapshotTestCase/FBSnapshotTestCase.h>
|
||||||
|
#import <FBSnapshotTestCase/FBSnapshotTestController.h>
|
||||||
#import "FBSnapshotTestController.h"
|
|
||||||
|
|
||||||
@implementation FBSnapshotTestCase
|
@implementation FBSnapshotTestCase
|
||||||
{
|
{
|
||||||
FBSnapshotTestController *_snapshotController;
|
FBSnapshotTestController *_snapshotController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - Overrides
|
||||||
|
|
||||||
- (void)setUp
|
- (void)setUp
|
||||||
{
|
{
|
||||||
[super setUp];
|
[super setUp];
|
||||||
@ -40,6 +41,30 @@
|
|||||||
_snapshotController.recordMode = recordMode;
|
_snapshotController.recordMode = recordMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isDeviceAgnostic
|
||||||
|
{
|
||||||
|
return _snapshotController.deviceAgnostic;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setDeviceAgnostic:(BOOL)deviceAgnostic
|
||||||
|
{
|
||||||
|
NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__);
|
||||||
|
_snapshotController.deviceAgnostic = deviceAgnostic;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)usesDrawViewHierarchyInRect
|
||||||
|
{
|
||||||
|
return _snapshotController.usesDrawViewHierarchyInRect;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setUsesDrawViewHierarchyInRect:(BOOL)usesDrawViewHierarchyInRect
|
||||||
|
{
|
||||||
|
NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__);
|
||||||
|
_snapshotController.usesDrawViewHierarchyInRect = usesDrawViewHierarchyInRect;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Public API
|
||||||
|
|
||||||
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer
|
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer
|
||||||
referenceImagesDirectory:(NSString *)referenceImagesDirectory
|
referenceImagesDirectory:(NSString *)referenceImagesDirectory
|
||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
@ -66,8 +91,33 @@
|
|||||||
error:errorPtr];
|
error:errorPtr];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
- (BOOL)referenceImageRecordedInDirectory:(NSString *)referenceImagesDirectory
|
||||||
#pragma mark Private API
|
identifier:(NSString *)identifier
|
||||||
|
error:(NSError **)errorPtr
|
||||||
|
{
|
||||||
|
NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__);
|
||||||
|
_snapshotController.referenceImagesDirectory = referenceImagesDirectory;
|
||||||
|
UIImage *referenceImage = [_snapshotController referenceImageForSelector:self.invocation.selector
|
||||||
|
identifier:identifier
|
||||||
|
error:errorPtr];
|
||||||
|
|
||||||
|
return (referenceImage != nil);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)getReferenceImageDirectoryWithDefault:(NSString *)dir
|
||||||
|
{
|
||||||
|
NSString *envReferenceImageDirectory = [NSProcessInfo processInfo].environment[@"FB_REFERENCE_IMAGE_DIR"];
|
||||||
|
if (envReferenceImageDirectory) {
|
||||||
|
return envReferenceImageDirectory;
|
||||||
|
}
|
||||||
|
if (dir && dir.length > 0) {
|
||||||
|
return dir;
|
||||||
|
}
|
||||||
|
return [[NSBundle bundleForClass:self.class].resourcePath stringByAppendingPathComponent:@"ReferenceImages"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark - Private API
|
||||||
|
|
||||||
- (BOOL)_compareSnapshotOfViewOrLayer:(id)viewOrLayer
|
- (BOOL)_compareSnapshotOfViewOrLayer:(id)viewOrLayer
|
||||||
referenceImagesDirectory:(NSString *)referenceImagesDirectory
|
referenceImagesDirectory:(NSString *)referenceImagesDirectory
|
||||||
|
|||||||
@ -31,6 +31,14 @@ BOOL FBSnapshotTestCaseIs64Bit(void);
|
|||||||
*/
|
*/
|
||||||
NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void);
|
NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns a fully «normalized» file name.
|
||||||
|
Strips punctuation and spaces and replaces them with @c _. Also appends the device model, running OS and screen size to the file name.
|
||||||
|
|
||||||
|
@returns An @c NSString object containing the passed @c fileName with the device model, OS and screen size appended at the end.
|
||||||
|
*/
|
||||||
|
NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import <FBSnapshotTestCase/FBSnapshotTestCasePlatform.h>
|
#import <FBSnapshotTestCase/FBSnapshotTestCasePlatform.h>
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
BOOL FBSnapshotTestCaseIs64Bit(void)
|
BOOL FBSnapshotTestCaseIs64Bit(void)
|
||||||
{
|
{
|
||||||
@ -29,3 +30,20 @@ NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void)
|
|||||||
}
|
}
|
||||||
return [suffixesSet copy];
|
return [suffixesSet copy];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName)
|
||||||
|
{
|
||||||
|
UIDevice *device = [UIDevice currentDevice];
|
||||||
|
CGSize screenSize = [[UIApplication sharedApplication] keyWindow].bounds.size;
|
||||||
|
NSString *os = device.systemVersion;
|
||||||
|
|
||||||
|
fileName = [NSString stringWithFormat:@"%@_%@%@_%.0fx%.0f", fileName, device.model, os, screenSize.width, screenSize.height];
|
||||||
|
|
||||||
|
NSMutableCharacterSet *invalidCharacters = [NSMutableCharacterSet new];
|
||||||
|
[invalidCharacters formUnionWithCharacterSet:[NSCharacterSet whitespaceCharacterSet]];
|
||||||
|
[invalidCharacters formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]];
|
||||||
|
NSArray *validComponents = [fileName componentsSeparatedByCharactersInSet:invalidCharacters];
|
||||||
|
fileName = [validComponents componentsJoinedByString:@"_"];
|
||||||
|
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013, Facebook, Inc.
|
* Copyright (c) 2015, Facebook, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the BSD-style license found in the
|
||||||
@ -37,9 +37,25 @@ extern NSString *const FBReferenceImageFilePathKey;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Record snapshots.
|
Record snapshots.
|
||||||
**/
|
*/
|
||||||
@property (readwrite, nonatomic, assign) BOOL recordMode;
|
@property (readwrite, nonatomic, assign) BOOL recordMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
When @c YES appends the name of the device model and OS to the snapshot file name.
|
||||||
|
The default value is @c NO.
|
||||||
|
*/
|
||||||
|
@property (readwrite, nonatomic, assign, getter=isDeviceAgnostic) BOOL deviceAgnostic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Uses drawViewHierarchyInRect:afterScreenUpdates: to draw the image instead of renderInContext:
|
||||||
|
*/
|
||||||
|
@property (readwrite, nonatomic, assign) BOOL usesDrawViewHierarchyInRect;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The directory in which referfence images are stored.
|
||||||
|
*/
|
||||||
|
@property (readwrite, nonatomic, copy) NSString *referenceImagesDirectory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param testClass The subclass of FBSnapshotTestCase that is using this controller.
|
@param testClass The subclass of FBSnapshotTestCase that is using this controller.
|
||||||
@returns An instance of FBSnapshotTestController.
|
@returns An instance of FBSnapshotTestController.
|
||||||
@ -53,7 +69,6 @@ extern NSString *const FBReferenceImageFilePathKey;
|
|||||||
*/
|
*/
|
||||||
- (instancetype)initWithTestName:(NSString *)testName;
|
- (instancetype)initWithTestName:(NSString *)testName;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Performs the comparison of the layer.
|
Performs the comparison of the layer.
|
||||||
@param layer The Layer to snapshot.
|
@param layer The Layer to snapshot.
|
||||||
@ -95,12 +110,6 @@ extern NSString *const FBReferenceImageFilePathKey;
|
|||||||
tolerance:(CGFloat)tolerance
|
tolerance:(CGFloat)tolerance
|
||||||
error:(NSError **)errorPtr;
|
error:(NSError **)errorPtr;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
The directory in which referfence images are stored.
|
|
||||||
*/
|
|
||||||
@property (readwrite, nonatomic, copy) NSString *referenceImagesDirectory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Loads a reference image.
|
Loads a reference image.
|
||||||
@param selector The test method being run.
|
@param selector The test method being run.
|
||||||
@ -112,18 +121,6 @@ extern NSString *const FBReferenceImageFilePathKey;
|
|||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
error:(NSError **)errorPtr;
|
error:(NSError **)errorPtr;
|
||||||
|
|
||||||
/**
|
|
||||||
Saves a reference image.
|
|
||||||
@param selector The test method being run.
|
|
||||||
@param identifier The optional identifier, used when multiple images are tested in a single -test method.
|
|
||||||
@param errorPtr An error, if this methods returns NO, the error will be something useful.
|
|
||||||
@returns An image.
|
|
||||||
*/
|
|
||||||
- (BOOL)saveReferenceImage:(UIImage *)image
|
|
||||||
selector:(SEL)selector
|
|
||||||
identifier:(NSString *)identifier
|
|
||||||
error:(NSError **)errorPtr;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Performs a pixel-by-pixel comparison of the two images with an allowable margin of error.
|
Performs a pixel-by-pixel comparison of the two images with an allowable margin of error.
|
||||||
@param referenceImage The reference (correct) image.
|
@param referenceImage The reference (correct) image.
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013, Facebook, Inc.
|
* Copyright (c) 2015, Facebook, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the BSD-style license found in the
|
||||||
@ -8,25 +8,31 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "FBSnapshotTestController.h"
|
#import <FBSnapshotTestCase/FBSnapshotTestController.h>
|
||||||
|
#import <FBSnapshotTestCase/FBSnapshotTestCasePlatform.h>
|
||||||
#import "UIImage+Compare.h"
|
#import <FBSnapshotTestCase/UIImage+Compare.h>
|
||||||
#import "UIImage+Diff.h"
|
#import <FBSnapshotTestCase/UIImage+Diff.h>
|
||||||
|
#import <FBSnapshotTestCase/UIImage+Snapshot.h>
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
NSString *const FBSnapshotTestControllerErrorDomain = @"FBSnapshotTestControllerErrorDomain";
|
NSString *const FBSnapshotTestControllerErrorDomain = @"FBSnapshotTestControllerErrorDomain";
|
||||||
|
|
||||||
NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
|
NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
||||||
|
FBTestSnapshotFileNameTypeReference,
|
||||||
|
FBTestSnapshotFileNameTypeFailedReference,
|
||||||
|
FBTestSnapshotFileNameTypeFailedTest,
|
||||||
|
FBTestSnapshotFileNameTypeFailedTestDiff,
|
||||||
|
};
|
||||||
|
|
||||||
@implementation FBSnapshotTestController
|
@implementation FBSnapshotTestController
|
||||||
{
|
{
|
||||||
NSString *_testName;
|
NSString *_testName;
|
||||||
NSFileManager *_fileManager;
|
NSFileManager *_fileManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark - Initializers
|
||||||
#pragma mark Lifecycle
|
|
||||||
|
|
||||||
- (instancetype)initWithTestClass:(Class)testClass;
|
- (instancetype)initWithTestClass:(Class)testClass;
|
||||||
{
|
{
|
||||||
@ -35,23 +41,60 @@ NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
|
|||||||
|
|
||||||
- (instancetype)initWithTestName:(NSString *)testName
|
- (instancetype)initWithTestName:(NSString *)testName
|
||||||
{
|
{
|
||||||
if ((self = [super init])) {
|
if (self = [super init]) {
|
||||||
_testName = [testName copy];
|
_testName = [testName copy];
|
||||||
|
_deviceAgnostic = NO;
|
||||||
|
|
||||||
_fileManager = [[NSFileManager alloc] init];
|
_fileManager = [[NSFileManager alloc] init];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark - Overrides
|
||||||
#pragma mark Properties
|
|
||||||
|
|
||||||
- (NSString *)description
|
- (NSString *)description
|
||||||
{
|
{
|
||||||
return [NSString stringWithFormat:@"%@ %@", [super description], _referenceImagesDirectory];
|
return [NSString stringWithFormat:@"%@ %@", [super description], _referenceImagesDirectory];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark - Public API
|
||||||
#pragma mark Public API
|
|
||||||
|
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer
|
||||||
|
selector:(SEL)selector
|
||||||
|
identifier:(NSString *)identifier
|
||||||
|
error:(NSError **)errorPtr
|
||||||
|
{
|
||||||
|
return [self compareSnapshotOfViewOrLayer:layer
|
||||||
|
selector:selector
|
||||||
|
identifier:identifier
|
||||||
|
tolerance:0
|
||||||
|
error:errorPtr];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)compareSnapshotOfView:(UIView *)view
|
||||||
|
selector:(SEL)selector
|
||||||
|
identifier:(NSString *)identifier
|
||||||
|
error:(NSError **)errorPtr
|
||||||
|
{
|
||||||
|
return [self compareSnapshotOfViewOrLayer:view
|
||||||
|
selector:selector
|
||||||
|
identifier:identifier
|
||||||
|
tolerance:0
|
||||||
|
error:errorPtr];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer
|
||||||
|
selector:(SEL)selector
|
||||||
|
identifier:(NSString *)identifier
|
||||||
|
tolerance:(CGFloat)tolerance
|
||||||
|
error:(NSError **)errorPtr
|
||||||
|
{
|
||||||
|
if (self.recordMode) {
|
||||||
|
return [self _recordSnapshotOfViewOrLayer:viewOrLayer selector:selector identifier:identifier error:errorPtr];
|
||||||
|
} else {
|
||||||
|
return [self _performPixelComparisonWithViewOrLayer:viewOrLayer selector:selector identifier:identifier tolerance:tolerance error:errorPtr];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (UIImage *)referenceImageForSelector:(SEL)selector
|
- (UIImage *)referenceImageForSelector:(SEL)selector
|
||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
@ -78,42 +121,33 @@ NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)saveReferenceImage:(UIImage *)image
|
- (BOOL)compareReferenceImage:(UIImage *)referenceImage
|
||||||
selector:(SEL)selector
|
toImage:(UIImage *)image
|
||||||
identifier:(NSString *)identifier
|
tolerance:(CGFloat)tolerance
|
||||||
error:(NSError **)errorPtr
|
error:(NSError **)errorPtr
|
||||||
{
|
{
|
||||||
BOOL didWrite = NO;
|
if (CGSizeEqualToSize(referenceImage.size, image.size)) {
|
||||||
if (nil != image) {
|
BOOL imagesEqual = [referenceImage fb_compareWithImage:image tolerance:tolerance];
|
||||||
NSString *filePath = [self _referenceFilePathForSelector:selector identifier:identifier];
|
|
||||||
NSData *pngData = UIImagePNGRepresentation(image);
|
|
||||||
if (nil != pngData) {
|
|
||||||
NSError *creationError = nil;
|
|
||||||
BOOL didCreateDir = [_fileManager createDirectoryAtPath:[filePath stringByDeletingLastPathComponent]
|
|
||||||
withIntermediateDirectories:YES
|
|
||||||
attributes:nil
|
|
||||||
error:&creationError];
|
|
||||||
if (!didCreateDir) {
|
|
||||||
if (NULL != errorPtr) {
|
if (NULL != errorPtr) {
|
||||||
*errorPtr = creationError;
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
didWrite = [pngData writeToFile:filePath options:NSDataWritingAtomic error:errorPtr];
|
|
||||||
if (didWrite) {
|
|
||||||
NSLog(@"Reference image save at: %@", filePath);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (nil != errorPtr) {
|
|
||||||
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
|
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
|
||||||
code:FBSnapshotTestControllerErrorCodePNGCreationFailed
|
code:FBSnapshotTestControllerErrorCodeImagesDifferent
|
||||||
userInfo:@{
|
userInfo:@{
|
||||||
FBReferenceImageFilePathKey: filePath,
|
NSLocalizedDescriptionKey: @"Images different",
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
return imagesEqual;
|
||||||
}
|
}
|
||||||
|
if (NULL != errorPtr) {
|
||||||
|
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
|
||||||
|
code:FBSnapshotTestControllerErrorCodeImagesDifferentSizes
|
||||||
|
userInfo:@{
|
||||||
|
NSLocalizedDescriptionKey: @"Images different sizes",
|
||||||
|
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"referenceImage:%@, image:%@",
|
||||||
|
NSStringFromCGSize(referenceImage.size),
|
||||||
|
NSStringFromCGSize(image.size)],
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
return didWrite;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)saveFailedReferenceImage:(UIImage *)referenceImage
|
- (BOOL)saveFailedReferenceImage:(UIImage *)referenceImage
|
||||||
@ -157,7 +191,7 @@ NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
|
|||||||
identifier:identifier
|
identifier:identifier
|
||||||
fileNameType:FBTestSnapshotFileNameTypeFailedTestDiff];
|
fileNameType:FBTestSnapshotFileNameTypeFailedTestDiff];
|
||||||
|
|
||||||
UIImage *diffImage = [referenceImage diffWithImage:testImage];
|
UIImage *diffImage = [referenceImage fb_diffWithImage:testImage];
|
||||||
NSData *diffImageData = UIImagePNGRepresentation(diffImage);
|
NSData *diffImageData = UIImagePNGRepresentation(diffImage);
|
||||||
|
|
||||||
if (![diffImageData writeToFile:diffPath options:NSDataWritingAtomic error:errorPtr]) {
|
if (![diffImageData writeToFile:diffPath options:NSDataWritingAtomic error:errorPtr]) {
|
||||||
@ -170,44 +204,7 @@ NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)compareReferenceImage:(UIImage *)referenceImage
|
#pragma mark - Private API
|
||||||
toImage:(UIImage *)image
|
|
||||||
tolerance:(CGFloat)tolerance
|
|
||||||
error:(NSError **)errorPtr {
|
|
||||||
if (CGSizeEqualToSize(referenceImage.size, image.size)) {
|
|
||||||
|
|
||||||
BOOL imagesEqual = [referenceImage compareWithImage:image tolerance:tolerance];
|
|
||||||
if (NULL != errorPtr) {
|
|
||||||
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
|
|
||||||
code:FBSnapshotTestControllerErrorCodeImagesDifferent
|
|
||||||
userInfo:@{
|
|
||||||
NSLocalizedDescriptionKey: @"Images different",
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
return imagesEqual;
|
|
||||||
}
|
|
||||||
if (NULL != errorPtr) {
|
|
||||||
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
|
|
||||||
code:FBSnapshotTestControllerErrorCodeImagesDifferentSizes
|
|
||||||
userInfo:@{
|
|
||||||
NSLocalizedDescriptionKey: @"Images different sizes",
|
|
||||||
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"referenceImage:%@, image:%@",
|
|
||||||
NSStringFromCGSize(referenceImage.size),
|
|
||||||
NSStringFromCGSize(image.size)],
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark -
|
|
||||||
#pragma mark Private API
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
|
||||||
FBTestSnapshotFileNameTypeReference,
|
|
||||||
FBTestSnapshotFileNameTypeFailedReference,
|
|
||||||
FBTestSnapshotFileNameTypeFailedTest,
|
|
||||||
FBTestSnapshotFileNameTypeFailedTestDiff,
|
|
||||||
};
|
|
||||||
|
|
||||||
- (NSString *)_fileNameForSelector:(SEL)selector
|
- (NSString *)_fileNameForSelector:(SEL)selector
|
||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
@ -232,6 +229,11 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
|||||||
if (0 < identifier.length) {
|
if (0 < identifier.length) {
|
||||||
fileName = [fileName stringByAppendingFormat:@"_%@", identifier];
|
fileName = [fileName stringByAppendingFormat:@"_%@", identifier];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self.isDeviceAgnostic) {
|
||||||
|
fileName = FBDeviceAgnosticNormalizedFileName(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
if ([[UIScreen mainScreen] scale] > 1) {
|
if ([[UIScreen mainScreen] scale] > 1) {
|
||||||
fileName = [fileName stringByAppendingFormat:@"@%.fx", [[UIScreen mainScreen] scale]];
|
fileName = [fileName stringByAppendingFormat:@"@%.fx", [[UIScreen mainScreen] scale]];
|
||||||
}
|
}
|
||||||
@ -239,7 +241,8 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
|||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)_referenceFilePathForSelector:(SEL)selector identifier:(NSString *)identifier
|
- (NSString *)_referenceFilePathForSelector:(SEL)selector
|
||||||
|
identifier:(NSString *)identifier
|
||||||
{
|
{
|
||||||
NSString *fileName = [self _fileNameForSelector:selector
|
NSString *fileName = [self _fileNameForSelector:selector
|
||||||
identifier:identifier
|
identifier:identifier
|
||||||
@ -265,46 +268,6 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
|||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer
|
|
||||||
selector:(SEL)selector
|
|
||||||
identifier:(NSString *)identifier
|
|
||||||
error:(NSError **)errorPtr
|
|
||||||
{
|
|
||||||
return [self compareSnapshotOfViewOrLayer:layer
|
|
||||||
selector:selector
|
|
||||||
identifier:identifier
|
|
||||||
tolerance:0
|
|
||||||
error:errorPtr];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)compareSnapshotOfView:(UIView *)view
|
|
||||||
selector:(SEL)selector
|
|
||||||
identifier:(NSString *)identifier
|
|
||||||
error:(NSError **)errorPtr
|
|
||||||
{
|
|
||||||
return [self compareSnapshotOfViewOrLayer:view
|
|
||||||
selector:selector
|
|
||||||
identifier:identifier
|
|
||||||
tolerance:0
|
|
||||||
error:errorPtr];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer
|
|
||||||
selector:(SEL)selector
|
|
||||||
identifier:(NSString *)identifier
|
|
||||||
tolerance:(CGFloat)tolerance
|
|
||||||
error:(NSError **)errorPtr
|
|
||||||
{
|
|
||||||
if (self.recordMode) {
|
|
||||||
return [self _recordSnapshotOfViewOrLayer:viewOrLayer selector:selector identifier:identifier error:errorPtr];
|
|
||||||
} else {
|
|
||||||
return [self _performPixelComparisonWithViewOrLayer:viewOrLayer selector:selector identifier:identifier tolerance:tolerance error:errorPtr];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark -
|
|
||||||
#pragma mark Private API
|
|
||||||
|
|
||||||
- (BOOL)_performPixelComparisonWithViewOrLayer:(id)viewOrLayer
|
- (BOOL)_performPixelComparisonWithViewOrLayer:(id)viewOrLayer
|
||||||
selector:(SEL)selector
|
selector:(SEL)selector
|
||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
@ -313,7 +276,7 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
|||||||
{
|
{
|
||||||
UIImage *referenceImage = [self referenceImageForSelector:selector identifier:identifier error:errorPtr];
|
UIImage *referenceImage = [self referenceImageForSelector:selector identifier:identifier error:errorPtr];
|
||||||
if (nil != referenceImage) {
|
if (nil != referenceImage) {
|
||||||
UIImage *snapshot = [self _snapshotViewOrLayer:viewOrLayer];
|
UIImage *snapshot = [self _imageForViewOrLayer:viewOrLayer];
|
||||||
BOOL imagesSame = [self compareReferenceImage:referenceImage toImage:snapshot tolerance:tolerance error:errorPtr];
|
BOOL imagesSame = [self compareReferenceImage:referenceImage toImage:snapshot tolerance:tolerance error:errorPtr];
|
||||||
if (!imagesSame) {
|
if (!imagesSame) {
|
||||||
[self saveFailedReferenceImage:referenceImage
|
[self saveFailedReferenceImage:referenceImage
|
||||||
@ -332,53 +295,62 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
|||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
error:(NSError **)errorPtr
|
error:(NSError **)errorPtr
|
||||||
{
|
{
|
||||||
UIImage *snapshot = [self _snapshotViewOrLayer:viewOrLayer];
|
UIImage *snapshot = [self _imageForViewOrLayer:viewOrLayer];
|
||||||
return [self saveReferenceImage:snapshot selector:selector identifier:identifier error:errorPtr];
|
return [self _saveReferenceImage:snapshot selector:selector identifier:identifier error:errorPtr];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIImage *)_snapshotViewOrLayer:(id)viewOrLayer
|
- (BOOL)_saveReferenceImage:(UIImage *)image
|
||||||
|
selector:(SEL)selector
|
||||||
|
identifier:(NSString *)identifier
|
||||||
|
error:(NSError **)errorPtr
|
||||||
{
|
{
|
||||||
CALayer *layer = nil;
|
BOOL didWrite = NO;
|
||||||
|
if (nil != image) {
|
||||||
|
NSString *filePath = [self _referenceFilePathForSelector:selector identifier:identifier];
|
||||||
|
NSData *pngData = UIImagePNGRepresentation(image);
|
||||||
|
if (nil != pngData) {
|
||||||
|
NSError *creationError = nil;
|
||||||
|
BOOL didCreateDir = [_fileManager createDirectoryAtPath:[filePath stringByDeletingLastPathComponent]
|
||||||
|
withIntermediateDirectories:YES
|
||||||
|
attributes:nil
|
||||||
|
error:&creationError];
|
||||||
|
if (!didCreateDir) {
|
||||||
|
if (NULL != errorPtr) {
|
||||||
|
*errorPtr = creationError;
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
didWrite = [pngData writeToFile:filePath options:NSDataWritingAtomic error:errorPtr];
|
||||||
|
if (didWrite) {
|
||||||
|
NSLog(@"Reference image save at: %@", filePath);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (nil != errorPtr) {
|
||||||
|
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
|
||||||
|
code:FBSnapshotTestControllerErrorCodePNGCreationFailed
|
||||||
|
userInfo:@{
|
||||||
|
FBReferenceImageFilePathKey: filePath,
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return didWrite;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UIImage *)_imageForViewOrLayer:(id)viewOrLayer
|
||||||
|
{
|
||||||
if ([viewOrLayer isKindOfClass:[UIView class]]) {
|
if ([viewOrLayer isKindOfClass:[UIView class]]) {
|
||||||
return [self _renderView:viewOrLayer];
|
if (_usesDrawViewHierarchyInRect) {
|
||||||
|
return [UIImage fb_imageForView:viewOrLayer];
|
||||||
|
} else {
|
||||||
|
return [UIImage fb_imageForViewLayer:viewOrLayer];
|
||||||
|
}
|
||||||
} else if ([viewOrLayer isKindOfClass:[CALayer class]]) {
|
} else if ([viewOrLayer isKindOfClass:[CALayer class]]) {
|
||||||
layer = (CALayer *)viewOrLayer;
|
return [UIImage fb_imageForLayer:viewOrLayer];
|
||||||
[layer layoutIfNeeded];
|
|
||||||
return [self _renderLayer:layer];
|
|
||||||
} else {
|
} else {
|
||||||
[NSException raise:@"Only UIView and CALayer classes can be snapshotted" format:@"%@", viewOrLayer];
|
[NSException raise:@"Only UIView and CALayer classes can be snapshotted" format:@"%@", viewOrLayer];
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIImage *)_renderLayer:(CALayer *)layer
|
|
||||||
{
|
|
||||||
CGRect bounds = layer.bounds;
|
|
||||||
|
|
||||||
NSAssert1(CGRectGetWidth(bounds), @"Zero width for layer %@", layer);
|
|
||||||
NSAssert1(CGRectGetHeight(bounds), @"Zero height for layer %@", layer);
|
|
||||||
|
|
||||||
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
|
|
||||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
|
||||||
NSAssert1(context, @"Could not generate context for layer %@", layer);
|
|
||||||
|
|
||||||
CGContextSaveGState(context);
|
|
||||||
{
|
|
||||||
[layer renderInContext:context];
|
|
||||||
}
|
|
||||||
CGContextRestoreGState(context);
|
|
||||||
|
|
||||||
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
|
|
||||||
UIGraphicsEndImageContext();
|
|
||||||
|
|
||||||
return snapshot;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (UIImage *)_renderView:(UIView *)view
|
|
||||||
{
|
|
||||||
[view layoutIfNeeded];
|
|
||||||
return [self _renderLayer:view.layer];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -10,40 +10,48 @@
|
|||||||
|
|
||||||
public extension FBSnapshotTestCase {
|
public extension FBSnapshotTestCase {
|
||||||
public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
|
public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
|
||||||
let envReferenceImageDirectory = NSProcessInfo.processInfo().environment["FB_REFERENCE_IMAGE_DIR"] as? String
|
FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes)
|
||||||
var error: NSError?
|
|
||||||
|
|
||||||
if let envReferenceImageDirectory = envReferenceImageDirectory {
|
|
||||||
for suffix in suffixes {
|
|
||||||
let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)"
|
|
||||||
let comparisonSuccess = compareSnapshotOfView(view, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0, error: &error)
|
|
||||||
if comparisonSuccess || recordMode {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line)
|
|
||||||
assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
assert(false, message: "Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.", file: file, line: line)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
|
public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
|
||||||
let envReferenceImageDirectory = NSProcessInfo.processInfo().environment["FB_REFERENCE_IMAGE_DIR"] as? String
|
FBSnapshotVerifyViewOrLayer(layer, identifier: identifier, suffixes: suffixes)
|
||||||
|
}
|
||||||
|
|
||||||
|
private func FBSnapshotVerifyViewOrLayer(viewOrLayer: AnyObject, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
|
||||||
|
let envReferenceImageDirectory = self.getReferenceImageDirectoryWithDefault(FB_REFERENCE_IMAGE_DIR)
|
||||||
var error: NSError?
|
var error: NSError?
|
||||||
var comparisonSuccess = false
|
var comparisonSuccess = false
|
||||||
|
|
||||||
if let envReferenceImageDirectory = envReferenceImageDirectory {
|
if let envReferenceImageDirectory = envReferenceImageDirectory {
|
||||||
for suffix in suffixes {
|
for suffix in suffixes {
|
||||||
let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)"
|
let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)"
|
||||||
comparisonSuccess = compareSnapshotOfLayer(layer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0, error: &error)
|
if viewOrLayer.isKindOfClass(UIView) {
|
||||||
|
do {
|
||||||
|
try compareSnapshotOfView(viewOrLayer as! UIView, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0)
|
||||||
|
comparisonSuccess = true
|
||||||
|
} catch let error1 as NSError {
|
||||||
|
error = error1
|
||||||
|
comparisonSuccess = false
|
||||||
|
}
|
||||||
|
} else if viewOrLayer.isKindOfClass(CALayer) {
|
||||||
|
do {
|
||||||
|
try compareSnapshotOfLayer(viewOrLayer as! CALayer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0)
|
||||||
|
comparisonSuccess = true
|
||||||
|
} catch let error1 as NSError {
|
||||||
|
error = error1
|
||||||
|
comparisonSuccess = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
assertionFailure("Only UIView and CALayer classes can be snapshotted")
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line)
|
||||||
|
|
||||||
if comparisonSuccess || recordMode {
|
if comparisonSuccess || recordMode {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line)
|
assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line)
|
||||||
assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
XCTFail("Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.")
|
XCTFail("Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.")
|
||||||
|
|||||||
6
Example/Pods/FBSnapshotTestCase/README.md
generated
6
Example/Pods/FBSnapshotTestCase/README.md
generated
@ -44,9 +44,7 @@ Installation with CocoaPods
|
|||||||
|
|
||||||
Replace "Tests" with the name of your test project.
|
Replace "Tests" with the name of your test project.
|
||||||
|
|
||||||
2. Define `FB_REFERENCE_IMAGE_DIR` in your scheme. This should
|
2. There are [three ways](https://github.com/facebook/ios-snapshot-test-case/blob/master/FBSnapshotTestCase/FBSnapshotTestCase.h#L19-L29) of setting reference image directories, the recommended one is to define `FB_REFERENCE_IMAGE_DIR` in your scheme. This should point to the directory where you want reference images to be stored. At Facebook, we normally use this:
|
||||||
point to the directory where you want reference images to be stored. At Facebook,
|
|
||||||
we normally use this:
|
|
||||||
|
|
||||||
|Name|Value|
|
|Name|Value|
|
||||||
|:---|:----|
|
|:---|:----|
|
||||||
@ -75,6 +73,8 @@ Features
|
|||||||
- Supply an optional "identifier" if you want to perform multiple snapshots
|
- Supply an optional "identifier" if you want to perform multiple snapshots
|
||||||
in a single test method.
|
in a single test method.
|
||||||
- Support for `CALayer` via `FBSnapshotVerifyLayer`.
|
- Support for `CALayer` via `FBSnapshotVerifyLayer`.
|
||||||
|
- `usesDrawViewHierarchyInRect` to handle cases like `UIVisualEffect`, `UIAppearance` and Size Classes.
|
||||||
|
- `isDeviceAgnostic` to allow appending the device model (`iPhone`, `iPad`, `iPod Touch`, etc), OS version and screen size to the images (allowing to have multiple tests for the same «snapshot» for different `OS`s and devices).
|
||||||
|
|
||||||
Notes
|
Notes
|
||||||
-----
|
-----
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h
|
|
||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.h
|
|
||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.h
|
|
||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Compare.h
|
|
||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Diff.h
|
|
||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h
|
|
||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.h
|
|
||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.h
|
|
||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Compare.h
|
|
||||||
@ -1 +0,0 @@
|
|||||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Diff.h
|
|
||||||
@ -1,22 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "NSString-Helper",
|
"name": "NSString-Helper",
|
||||||
"version": "0.1.0",
|
"version": "1.0.2",
|
||||||
"summary": "A short description of NSString-Helper.",
|
"summary": "NSString-Helper is usefull helper to validate email NSString",
|
||||||
"description": " An optional longer description of NSString-Helper\n\n * Markdown format.\n * Don't worry about the indent, we strip it!\n",
|
"homepage": "https://github.com/giuseppenucifora/NSString-Helper",
|
||||||
"homepage": "https://github.com/<GITHUB_USERNAME>/NSString-Helper",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": {
|
"authors": {
|
||||||
"Giuseppe Nucifora": "me@giuseppenucifora.com"
|
"Giuseppe Nucifora": "me@giuseppenucifora.com"
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"git": "https://github.com/<GITHUB_USERNAME>/NSString-Helper.git",
|
"git": "https://github.com/giuseppenucifora/NSString-Helper.git",
|
||||||
"tag": "0.1.0"
|
"tag": "1.0.2"
|
||||||
},
|
|
||||||
"platforms": {
|
|
||||||
"ios": "7.0"
|
|
||||||
},
|
},
|
||||||
|
"social_media_url": "https://twitter.com/giuseppenuc",
|
||||||
"requires_arc": true,
|
"requires_arc": true,
|
||||||
"source_files": "Pod/Classes/**/*",
|
"platforms": {
|
||||||
|
"ios": "8.0"
|
||||||
|
},
|
||||||
|
"source_files": "NSString-Helper/*.{h,m}",
|
||||||
"resource_bundles": {
|
"resource_bundles": {
|
||||||
"NSString-Helper": [
|
"NSString-Helper": [
|
||||||
"Pod/Assets/*.png"
|
"Pod/Assets/*.png"
|
||||||
|
|||||||
20
Example/Pods/Manifest.lock
generated
20
Example/Pods/Manifest.lock
generated
@ -1,10 +1,10 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- FBSnapshotTestCase (2.0.2):
|
- FBSnapshotTestCase (2.0.7):
|
||||||
- FBSnapshotTestCase/SwiftSupport (= 2.0.2)
|
- FBSnapshotTestCase/SwiftSupport (= 2.0.7)
|
||||||
- FBSnapshotTestCase/Core (2.0.2)
|
- FBSnapshotTestCase/Core (2.0.7)
|
||||||
- FBSnapshotTestCase/SwiftSupport (2.0.2):
|
- FBSnapshotTestCase/SwiftSupport (2.0.7):
|
||||||
- FBSnapshotTestCase/Core
|
- FBSnapshotTestCase/Core
|
||||||
- NSString-Helper (0.1.0)
|
- NSString-Helper (1.0.2)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- FBSnapshotTestCase
|
- FBSnapshotTestCase
|
||||||
@ -12,10 +12,12 @@ DEPENDENCIES:
|
|||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
NSString-Helper:
|
NSString-Helper:
|
||||||
:path: ../
|
:path: "../"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
FBSnapshotTestCase: fd500d5b282c4ec60215d26d0b58b0cf271dd0d6
|
FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
|
||||||
NSString-Helper: 9b95cbcfebaf8aae322a0c9018bcbf97dec93167
|
NSString-Helper: 0ee74919829a332f9838fa87b28cb2d1d991e92c
|
||||||
|
|
||||||
COCOAPODS: 0.37.2
|
PODFILE CHECKSUM: a88b2ea7b96d7de499d212328481d74fcf022692
|
||||||
|
|
||||||
|
COCOAPODS: 1.0.0.beta.2
|
||||||
|
|||||||
1431
Example/Pods/Pods.xcodeproj/project.pbxproj
generated
1431
Example/Pods/Pods.xcodeproj/project.pbxproj
generated
File diff suppressed because it is too large
Load Diff
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Workspace
|
|
||||||
version = "1.0">
|
|
||||||
<FileRef
|
|
||||||
location = "self:">
|
|
||||||
</FileRef>
|
|
||||||
</Workspace>
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "0640"
|
LastUpgradeVersion = "0700"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
@ -14,39 +14,51 @@
|
|||||||
buildForAnalyzing = "YES">
|
buildForAnalyzing = "YES">
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "A36D8E48E8E506F420FE2A56"
|
BlueprintIdentifier = "6F621F2F34EEA2E2A05B25FA44939F5D"
|
||||||
BuildableName = "NSString_Helper.framework"
|
BuildableName = "NSString_Helper.framework"
|
||||||
BlueprintName = "Pods-NSString-Helper_Tests-NSString-Helper"
|
BlueprintName = "NSString-Helper"
|
||||||
ReferencedContainer = "container:Pods.xcodeproj">
|
ReferencedContainer = "container:Pods.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildActionEntry>
|
</BuildActionEntry>
|
||||||
</BuildActionEntries>
|
</BuildActionEntries>
|
||||||
</BuildAction>
|
</BuildAction>
|
||||||
<TestAction
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
buildConfiguration = "Debug">
|
|
||||||
<Testables>
|
<Testables>
|
||||||
</Testables>
|
</Testables>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
useCustomWorkingDirectory = "NO"
|
useCustomWorkingDirectory = "NO"
|
||||||
buildConfiguration = "Debug"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
debugDocumentVersioning = "YES"
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
allowLocationSimulation = "YES">
|
allowLocationSimulation = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "6F621F2F34EEA2E2A05B25FA44939F5D"
|
||||||
|
BuildableName = "NSString_Helper.framework"
|
||||||
|
BlueprintName = "NSString-Helper"
|
||||||
|
ReferencedContainer = "container:Pods.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
<AdditionalOptions>
|
<AdditionalOptions>
|
||||||
</AdditionalOptions>
|
</AdditionalOptions>
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
savedToolIdentifier = ""
|
savedToolIdentifier = ""
|
||||||
useCustomWorkingDirectory = "NO"
|
useCustomWorkingDirectory = "NO"
|
||||||
buildConfiguration = "Release"
|
|
||||||
debugDocumentVersioning = "YES">
|
debugDocumentVersioning = "YES">
|
||||||
</ProfileAction>
|
</ProfileAction>
|
||||||
<AnalyzeAction
|
<AnalyzeAction
|
||||||
@ -1,59 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "0640"
|
|
||||||
version = "1.3">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "ABAFADA0367925A4D6761852"
|
|
||||||
BuildableName = "NSString-Helper.bundle"
|
|
||||||
BlueprintName = "Pods-NSString-Helper_Example-NSString-Helper-NSString-Helper"
|
|
||||||
ReferencedContainer = "container:Pods.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
<Testables>
|
|
||||||
</Testables>
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "0640"
|
|
||||||
version = "1.3">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "E31EA94E32C3E93E90155B13"
|
|
||||||
BuildableName = "NSString_Helper.framework"
|
|
||||||
BlueprintName = "Pods-NSString-Helper_Example-NSString-Helper"
|
|
||||||
ReferencedContainer = "container:Pods.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
<Testables>
|
|
||||||
</Testables>
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "0640"
|
|
||||||
version = "1.3">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "B25F64EABD0565F6D1B7A46A"
|
|
||||||
BuildableName = "NSString-Helper.bundle"
|
|
||||||
BlueprintName = "Pods-NSString-Helper_Tests-NSString-Helper-NSString-Helper"
|
|
||||||
ReferencedContainer = "container:Pods.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
<Testables>
|
|
||||||
</Testables>
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
||||||
5
Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-dummy.m
generated
Normal file
5
Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-dummy.m
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
@interface PodsDummy_FBSnapshotTestCase : NSObject
|
||||||
|
@end
|
||||||
|
@implementation PodsDummy_FBSnapshotTestCase
|
||||||
|
@end
|
||||||
4
Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-prefix.pch
generated
Normal file
4
Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-prefix.pch
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#ifdef __OBJC__
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
15
Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.modulemap
generated
Normal file
15
Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.modulemap
generated
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
framework module FBSnapshotTestCase {
|
||||||
|
umbrella header "FBSnapshotTestCase.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
|
||||||
|
header "FBSnapshotTestCase.h"
|
||||||
|
header "FBSnapshotTestCasePlatform.h"
|
||||||
|
header "FBSnapshotTestController.h"
|
||||||
|
|
||||||
|
private header "UIImage+Compare.h"
|
||||||
|
private header "UIImage+Diff.h"
|
||||||
|
private header "UIImage+Snapshot.h"
|
||||||
|
}
|
||||||
|
|
||||||
9
Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.xcconfig
generated
Normal file
9
Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.xcconfig
generated
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
ENABLE_BITCODE = NO
|
||||||
|
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
|
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
|
||||||
|
OTHER_LDFLAGS = -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -framework "XCTest"
|
||||||
|
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||||
|
PODS_ROOT = ${SRCROOT}
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||||
|
SKIP_INSTALL = YES
|
||||||
@ -7,7 +7,7 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
|
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.0</string>
|
<string>2.0.7</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
@ -7,7 +7,7 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
|
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.0.2</string>
|
<string>1.0.2</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
5
Example/Pods/Target Support Files/NSString-Helper/NSString-Helper-dummy.m
generated
Normal file
5
Example/Pods/Target Support Files/NSString-Helper/NSString-Helper-dummy.m
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
@interface PodsDummy_NSString_Helper : NSObject
|
||||||
|
@end
|
||||||
|
@implementation PodsDummy_NSString_Helper
|
||||||
|
@end
|
||||||
4
Example/Pods/Target Support Files/NSString-Helper/NSString-Helper-prefix.pch
generated
Normal file
4
Example/Pods/Target Support Files/NSString-Helper/NSString-Helper-prefix.pch
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#ifdef __OBJC__
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
@ -1,5 +1,6 @@
|
|||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
#import "NSString+Helper.h"
|
||||||
|
|
||||||
FOUNDATION_EXPORT double NSString_HelperVersionNumber;
|
FOUNDATION_EXPORT double NSString_HelperVersionNumber;
|
||||||
FOUNDATION_EXPORT const unsigned char NSString_HelperVersionString[];
|
FOUNDATION_EXPORT const unsigned char NSString_HelperVersionString[];
|
||||||
6
Example/Pods/Target Support Files/NSString-Helper/NSString-Helper.modulemap
generated
Normal file
6
Example/Pods/Target Support Files/NSString-Helper/NSString-Helper.modulemap
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
framework module NSString_Helper {
|
||||||
|
umbrella header "NSString-Helper-umbrella.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
}
|
||||||
5
Example/Pods/Target Support Files/NSString-Helper/NSString-Helper.xcconfig
generated
Normal file
5
Example/Pods/Target Support Files/NSString-Helper/NSString-Helper.xcconfig
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
|
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
|
||||||
|
PODS_ROOT = ${SRCROOT}
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||||
|
SKIP_INSTALL = YES
|
||||||
@ -4,18 +4,16 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
|
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>BNDL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.0</string>
|
<string>1.0.2</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
@ -1,9 +0,0 @@
|
|||||||
#include "Pods-NSString-Helper_Example-NSString-Helper.xcconfig"
|
|
||||||
CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH
|
|
||||||
FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH"
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
|
||||||
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/NSString-Helper" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/NSString-Helper"
|
|
||||||
OTHER_LDFLAGS = -ObjC
|
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Example
|
|
||||||
PODS_ROOT = ${SRCROOT}
|
|
||||||
SKIP_INSTALL = YES
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
#import <Foundation/Foundation.h>
|
|
||||||
@interface PodsDummy_Pods_NSString_Helper_Example_NSString_Helper : NSObject
|
|
||||||
@end
|
|
||||||
@implementation PodsDummy_Pods_NSString_Helper_Example_NSString_Helper
|
|
||||||
@end
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
#ifdef __OBJC__
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import "Pods-NSString-Helper_Example-environment.h"
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT double NSString_HelperVersionNumber;
|
|
||||||
FOUNDATION_EXPORT const unsigned char NSString_HelperVersionString[];
|
|
||||||
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
framework module NSString_Helper {
|
|
||||||
umbrella header "Pods-NSString-Helper_Example-NSString-Helper-umbrella.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
module * { export * }
|
|
||||||
}
|
|
||||||
@ -7,7 +7,7 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
|
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
|
|||||||
@ -23,4 +23,4 @@ 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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
Generated by CocoaPods - http://cocoapods.org
|
Generated by CocoaPods - https://cocoapods.org
|
||||||
|
|||||||
@ -41,7 +41,7 @@ THE SOFTWARE.
|
|||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>FooterText</key>
|
<key>FooterText</key>
|
||||||
<string>Generated by CocoaPods - http://cocoapods.org</string>
|
<string>Generated by CocoaPods - https://cocoapods.org</string>
|
||||||
<key>Title</key>
|
<key>Title</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
// To check if a library is compiled with CocoaPods you
|
|
||||||
// can use the `COCOAPODS` macro definition which is
|
|
||||||
// defined in the xcconfigs so it is available in
|
|
||||||
// headers also when they are imported in the client
|
|
||||||
// project.
|
|
||||||
|
|
||||||
|
|
||||||
// NSString-Helper
|
|
||||||
#define COCOAPODS_POD_AVAILABLE_NSString_Helper
|
|
||||||
#define COCOAPODS_VERSION_MAJOR_NSString_Helper 0
|
|
||||||
#define COCOAPODS_VERSION_MINOR_NSString_Helper 1
|
|
||||||
#define COCOAPODS_VERSION_PATCH_NSString_Helper 0
|
|
||||||
|
|
||||||
@ -8,48 +8,84 @@ SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
|
|||||||
|
|
||||||
install_framework()
|
install_framework()
|
||||||
{
|
{
|
||||||
local source="${BUILT_PRODUCTS_DIR}/Pods-NSString-Helper_Example/$1"
|
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
|
||||||
|
local source="${BUILT_PRODUCTS_DIR}/$1"
|
||||||
|
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
|
||||||
|
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
|
||||||
|
elif [ -r "$1" ]; then
|
||||||
|
local source="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
|
|
||||||
if [ -L "${source}" ]; then
|
if [ -L "${source}" ]; then
|
||||||
echo "Symlinked..."
|
echo "Symlinked..."
|
||||||
source=$(readlink "${source}")
|
source="$(readlink "${source}")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# use filter instead of exclude so missing patterns dont' throw errors
|
# use filter instead of exclude so missing patterns dont' throw errors
|
||||||
echo "rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" ${source} ${destination}"
|
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
|
||||||
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" "${source}" "${destination}"
|
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
|
||||||
# Resign the code if required by the build settings to avoid unstable apps
|
|
||||||
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
|
local basename
|
||||||
code_sign "${destination}/$1"
|
basename="$(basename -s .framework "$1")"
|
||||||
|
binary="${destination}/${basename}.framework/${basename}"
|
||||||
|
if ! [ -r "$binary" ]; then
|
||||||
|
binary="${destination}/${basename}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Embed linked Swift runtime libraries
|
# Strip invalid architectures so "fat" simulator / device frameworks work on device
|
||||||
local basename
|
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
|
||||||
basename=$(echo $1 | sed -E s/\\..+// && exit ${PIPESTATUS[0]})
|
strip_invalid_archs "$binary"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Resign the code if required by the build settings to avoid unstable apps
|
||||||
|
code_sign_if_enabled "${destination}/$(basename "$1")"
|
||||||
|
|
||||||
|
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
|
||||||
|
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
|
||||||
local swift_runtime_libs
|
local swift_runtime_libs
|
||||||
swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$1/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
||||||
for lib in $swift_runtime_libs; do
|
for lib in $swift_runtime_libs; do
|
||||||
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
||||||
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
||||||
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
|
code_sign_if_enabled "${destination}/${lib}"
|
||||||
code_sign "${destination}/${lib}"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Signs a framework with the provided identity
|
# Signs a framework with the provided identity
|
||||||
code_sign() {
|
code_sign_if_enabled() {
|
||||||
|
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
|
||||||
# Use the current code_sign_identitiy
|
# Use the current code_sign_identitiy
|
||||||
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
||||||
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1"
|
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
|
||||||
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
|
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Strip invalid architectures
|
||||||
|
strip_invalid_archs() {
|
||||||
|
binary="$1"
|
||||||
|
# Get architectures for current file
|
||||||
|
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
|
||||||
|
stripped=""
|
||||||
|
for arch in $archs; do
|
||||||
|
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
|
||||||
|
# Strip non-valid architectures in-place
|
||||||
|
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
|
||||||
|
stripped="$stripped $arch"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ "$stripped" ]]; then
|
||||||
|
echo "Stripped $binary of architectures:$stripped"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||||
install_framework 'NSString_Helper.framework'
|
install_framework "Pods-NSString-Helper_Example/NSString_Helper.framework"
|
||||||
fi
|
fi
|
||||||
if [[ "$CONFIGURATION" == "Release" ]]; then
|
if [[ "$CONFIGURATION" == "Release" ]]; then
|
||||||
install_framework 'NSString_Helper.framework'
|
install_framework "Pods-NSString-Helper_Example/NSString_Helper.framework"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -9,57 +9,66 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
|
|||||||
XCASSET_FILES=()
|
XCASSET_FILES=()
|
||||||
|
|
||||||
realpath() {
|
realpath() {
|
||||||
DIRECTORY=$(cd "${1%/*}" && pwd)
|
DIRECTORY="$(cd "${1%/*}" && pwd)"
|
||||||
FILENAME="${1##*/}"
|
FILENAME="${1##*/}"
|
||||||
echo "$DIRECTORY/$FILENAME"
|
echo "$DIRECTORY/$FILENAME"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_resource()
|
install_resource()
|
||||||
{
|
{
|
||||||
case $1 in
|
if [[ "$1" = /* ]] ; then
|
||||||
|
RESOURCE_PATH="$1"
|
||||||
|
else
|
||||||
|
RESOURCE_PATH="${PODS_ROOT}/$1"
|
||||||
|
fi
|
||||||
|
if [[ ! -e "$RESOURCE_PATH" ]] ; then
|
||||||
|
cat << EOM
|
||||||
|
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
|
||||||
|
EOM
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
case $RESOURCE_PATH in
|
||||||
*.storyboard)
|
*.storyboard)
|
||||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
|
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT}"
|
||||||
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
|
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}"
|
||||||
;;
|
;;
|
||||||
*.xib)
|
*.xib)
|
||||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
|
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
|
||||||
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
|
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
|
||||||
;;
|
;;
|
||||||
*.framework)
|
*.framework)
|
||||||
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
echo "rsync -av $RESOURCE_PATH ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
rsync -av "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
;;
|
;;
|
||||||
*.xcdatamodel)
|
*.xcdatamodel)
|
||||||
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
|
echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
|
||||||
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
|
xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
|
||||||
;;
|
;;
|
||||||
*.xcdatamodeld)
|
*.xcdatamodeld)
|
||||||
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
|
echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
|
||||||
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
|
xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
|
||||||
;;
|
;;
|
||||||
*.xcmappingmodel)
|
*.xcmappingmodel)
|
||||||
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
|
echo "xcrun mapc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
|
||||||
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
|
xcrun mapc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
|
||||||
;;
|
;;
|
||||||
*.xcassets)
|
*.xcassets)
|
||||||
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
|
ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
|
||||||
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
||||||
;;
|
;;
|
||||||
/*)
|
|
||||||
echo "$1"
|
|
||||||
echo "$1" >> "$RESOURCES_TO_COPY"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "${PODS_ROOT}/$1"
|
echo "$RESOURCE_PATH"
|
||||||
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
|
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
if [[ "${ACTION}" == "install" ]]; then
|
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
|
||||||
|
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
fi
|
fi
|
||||||
rm -f "$RESOURCES_TO_COPY"
|
rm -f "$RESOURCES_TO_COPY"
|
||||||
@ -89,5 +98,5 @@ then
|
|||||||
fi
|
fi
|
||||||
done <<<"$OTHER_XCASSETS"
|
done <<<"$OTHER_XCASSETS"
|
||||||
|
|
||||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH"
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/NSString_Helper.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -ObjC -framework "NSString_Helper"
|
OTHER_LDFLAGS = $(inherited) -framework "NSString_Helper"
|
||||||
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
|
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Example
|
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Example
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
@ -1,8 +1,6 @@
|
|||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH"
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/NSString_Helper.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -ObjC -framework "NSString_Helper"
|
OTHER_LDFLAGS = $(inherited) -framework "NSString_Helper"
|
||||||
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
|
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Example
|
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Example
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
@ -1,10 +0,0 @@
|
|||||||
#include "Pods-NSString-Helper_Tests-FBSnapshotTestCase.xcconfig"
|
|
||||||
CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH
|
|
||||||
FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" ${PODS_NSSTRING_HELPER_TESTS_FBSNAPSHOTTESTCASE_FRAMEWORK_SEARCH_PATHS}
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
|
||||||
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/NSString-Helper"
|
|
||||||
OTHER_LDFLAGS = ${PODS_NSSTRING_HELPER_TESTS_FBSNAPSHOTTESTCASE_OTHER_LDFLAGS} -ObjC
|
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Tests
|
|
||||||
PODS_ROOT = ${SRCROOT}
|
|
||||||
SKIP_INSTALL = YES
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
#import <Foundation/Foundation.h>
|
|
||||||
@interface PodsDummy_Pods_NSString_Helper_Tests_FBSnapshotTestCase : NSObject
|
|
||||||
@end
|
|
||||||
@implementation PodsDummy_Pods_NSString_Helper_Tests_FBSnapshotTestCase
|
|
||||||
@end
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
#ifdef __OBJC__
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import "Pods-NSString-Helper_Tests-environment.h"
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
#import "FBSnapshotTestCase.h"
|
|
||||||
#import "FBSnapshotTestCasePlatform.h"
|
|
||||||
#import "FBSnapshotTestCase.h"
|
|
||||||
#import "FBSnapshotTestCasePlatform.h"
|
|
||||||
#import "FBSnapshotTestController.h"
|
|
||||||
#import "UIImage+Compare.h"
|
|
||||||
#import "UIImage+Diff.h"
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT double FBSnapshotTestCaseVersionNumber;
|
|
||||||
FOUNDATION_EXPORT const unsigned char FBSnapshotTestCaseVersionString[];
|
|
||||||
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
framework module FBSnapshotTestCase {
|
|
||||||
umbrella header "Pods-NSString-Helper_Tests-FBSnapshotTestCase-umbrella.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
module * { export * }
|
|
||||||
|
|
||||||
private header "FBSnapshotTestController.h"
|
|
||||||
private header "UIImage+Compare.h"
|
|
||||||
private header "UIImage+Diff.h"
|
|
||||||
}
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
PODS_NSSTRING_HELPER_TESTS_FBSNAPSHOTTESTCASE_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(PLATFORM_DIR)/Developer/Library/Frameworks"
|
|
||||||
PODS_NSSTRING_HELPER_TESTS_FBSNAPSHOTTESTCASE_OTHER_LDFLAGS = -framework "XCTest"
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
#include "Pods-NSString-Helper_Tests-NSString-Helper.xcconfig"
|
|
||||||
CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH
|
|
||||||
FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH"
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
|
||||||
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/NSString-Helper" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/NSString-Helper"
|
|
||||||
OTHER_LDFLAGS = -ObjC
|
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Tests
|
|
||||||
PODS_ROOT = ${SRCROOT}
|
|
||||||
SKIP_INSTALL = YES
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
#import <Foundation/Foundation.h>
|
|
||||||
@interface PodsDummy_Pods_NSString_Helper_Tests_NSString_Helper : NSObject
|
|
||||||
@end
|
|
||||||
@implementation PodsDummy_Pods_NSString_Helper_Tests_NSString_Helper
|
|
||||||
@end
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
#ifdef __OBJC__
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import "Pods-NSString-Helper_Tests-environment.h"
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
framework module NSString_Helper {
|
|
||||||
umbrella header "Pods-NSString-Helper_Tests-NSString-Helper-umbrella.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
module * { export * }
|
|
||||||
}
|
|
||||||
@ -7,7 +7,7 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
|
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
|
|||||||
@ -1,6 +1,29 @@
|
|||||||
# Acknowledgements
|
# Acknowledgements
|
||||||
This application makes use of the following third party libraries:
|
This application makes use of the following third party libraries:
|
||||||
|
|
||||||
|
## NSString-Helper
|
||||||
|
|
||||||
|
Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
## FBSnapshotTestCase
|
## FBSnapshotTestCase
|
||||||
|
|
||||||
BSD License
|
BSD License
|
||||||
@ -33,27 +56,4 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|||||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
Generated by CocoaPods - https://cocoapods.org
|
||||||
## NSString-Helper
|
|
||||||
|
|
||||||
Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com>
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
Generated by CocoaPods - http://cocoapods.org
|
|
||||||
|
|||||||
@ -12,6 +12,33 @@
|
|||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSGroupSpecifier</string>
|
<string>PSGroupSpecifier</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>FooterText</key>
|
||||||
|
<string>Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com>
|
||||||
|
|
||||||
|
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.
|
||||||
|
</string>
|
||||||
|
<key>Title</key>
|
||||||
|
<string>NSString-Helper</string>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>PSGroupSpecifier</string>
|
||||||
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>FooterText</key>
|
<key>FooterText</key>
|
||||||
<string>BSD License
|
<string>BSD License
|
||||||
@ -51,34 +78,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>FooterText</key>
|
<key>FooterText</key>
|
||||||
<string>Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com>
|
<string>Generated by CocoaPods - https://cocoapods.org</string>
|
||||||
|
|
||||||
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.
|
|
||||||
</string>
|
|
||||||
<key>Title</key>
|
|
||||||
<string>NSString-Helper</string>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>PSGroupSpecifier</string>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>FooterText</key>
|
|
||||||
<string>Generated by CocoaPods - http://cocoapods.org</string>
|
|
||||||
<key>Title</key>
|
<key>Title</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
|
|
||||||
// To check if a library is compiled with CocoaPods you
|
|
||||||
// can use the `COCOAPODS` macro definition which is
|
|
||||||
// defined in the xcconfigs so it is available in
|
|
||||||
// headers also when they are imported in the client
|
|
||||||
// project.
|
|
||||||
|
|
||||||
|
|
||||||
// FBSnapshotTestCase
|
|
||||||
#define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase
|
|
||||||
#define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase 2
|
|
||||||
#define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase 0
|
|
||||||
#define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase 2
|
|
||||||
|
|
||||||
// FBSnapshotTestCase/Core
|
|
||||||
#define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase_Core
|
|
||||||
#define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase_Core 2
|
|
||||||
#define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase_Core 0
|
|
||||||
#define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase_Core 2
|
|
||||||
|
|
||||||
// FBSnapshotTestCase/SwiftSupport
|
|
||||||
#define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase_SwiftSupport
|
|
||||||
#define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase_SwiftSupport 2
|
|
||||||
#define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase_SwiftSupport 0
|
|
||||||
#define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase_SwiftSupport 2
|
|
||||||
|
|
||||||
// NSString-Helper
|
|
||||||
#define COCOAPODS_POD_AVAILABLE_NSString_Helper
|
|
||||||
#define COCOAPODS_VERSION_MAJOR_NSString_Helper 0
|
|
||||||
#define COCOAPODS_VERSION_MINOR_NSString_Helper 1
|
|
||||||
#define COCOAPODS_VERSION_PATCH_NSString_Helper 0
|
|
||||||
|
|
||||||
@ -8,50 +8,86 @@ SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
|
|||||||
|
|
||||||
install_framework()
|
install_framework()
|
||||||
{
|
{
|
||||||
local source="${BUILT_PRODUCTS_DIR}/Pods-NSString-Helper_Tests/$1"
|
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
|
||||||
|
local source="${BUILT_PRODUCTS_DIR}/$1"
|
||||||
|
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
|
||||||
|
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
|
||||||
|
elif [ -r "$1" ]; then
|
||||||
|
local source="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
|
|
||||||
if [ -L "${source}" ]; then
|
if [ -L "${source}" ]; then
|
||||||
echo "Symlinked..."
|
echo "Symlinked..."
|
||||||
source=$(readlink "${source}")
|
source="$(readlink "${source}")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# use filter instead of exclude so missing patterns dont' throw errors
|
# use filter instead of exclude so missing patterns dont' throw errors
|
||||||
echo "rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" ${source} ${destination}"
|
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
|
||||||
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" "${source}" "${destination}"
|
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
|
||||||
# Resign the code if required by the build settings to avoid unstable apps
|
|
||||||
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
|
local basename
|
||||||
code_sign "${destination}/$1"
|
basename="$(basename -s .framework "$1")"
|
||||||
|
binary="${destination}/${basename}.framework/${basename}"
|
||||||
|
if ! [ -r "$binary" ]; then
|
||||||
|
binary="${destination}/${basename}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Embed linked Swift runtime libraries
|
# Strip invalid architectures so "fat" simulator / device frameworks work on device
|
||||||
local basename
|
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
|
||||||
basename=$(echo $1 | sed -E s/\\..+// && exit ${PIPESTATUS[0]})
|
strip_invalid_archs "$binary"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Resign the code if required by the build settings to avoid unstable apps
|
||||||
|
code_sign_if_enabled "${destination}/$(basename "$1")"
|
||||||
|
|
||||||
|
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
|
||||||
|
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
|
||||||
local swift_runtime_libs
|
local swift_runtime_libs
|
||||||
swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$1/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
||||||
for lib in $swift_runtime_libs; do
|
for lib in $swift_runtime_libs; do
|
||||||
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
||||||
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
||||||
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
|
code_sign_if_enabled "${destination}/${lib}"
|
||||||
code_sign "${destination}/${lib}"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Signs a framework with the provided identity
|
# Signs a framework with the provided identity
|
||||||
code_sign() {
|
code_sign_if_enabled() {
|
||||||
|
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
|
||||||
# Use the current code_sign_identitiy
|
# Use the current code_sign_identitiy
|
||||||
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
||||||
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1"
|
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
|
||||||
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
|
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Strip invalid architectures
|
||||||
|
strip_invalid_archs() {
|
||||||
|
binary="$1"
|
||||||
|
# Get architectures for current file
|
||||||
|
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
|
||||||
|
stripped=""
|
||||||
|
for arch in $archs; do
|
||||||
|
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
|
||||||
|
# Strip non-valid architectures in-place
|
||||||
|
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
|
||||||
|
stripped="$stripped $arch"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ "$stripped" ]]; then
|
||||||
|
echo "Stripped $binary of architectures:$stripped"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||||
install_framework 'FBSnapshotTestCase.framework'
|
install_framework "Pods-NSString-Helper_Tests/NSString_Helper.framework"
|
||||||
install_framework 'NSString_Helper.framework'
|
install_framework "Pods-NSString-Helper_Tests/FBSnapshotTestCase.framework"
|
||||||
fi
|
fi
|
||||||
if [[ "$CONFIGURATION" == "Release" ]]; then
|
if [[ "$CONFIGURATION" == "Release" ]]; then
|
||||||
install_framework 'FBSnapshotTestCase.framework'
|
install_framework "Pods-NSString-Helper_Tests/NSString_Helper.framework"
|
||||||
install_framework 'NSString_Helper.framework'
|
install_framework "Pods-NSString-Helper_Tests/FBSnapshotTestCase.framework"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -9,57 +9,66 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
|
|||||||
XCASSET_FILES=()
|
XCASSET_FILES=()
|
||||||
|
|
||||||
realpath() {
|
realpath() {
|
||||||
DIRECTORY=$(cd "${1%/*}" && pwd)
|
DIRECTORY="$(cd "${1%/*}" && pwd)"
|
||||||
FILENAME="${1##*/}"
|
FILENAME="${1##*/}"
|
||||||
echo "$DIRECTORY/$FILENAME"
|
echo "$DIRECTORY/$FILENAME"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_resource()
|
install_resource()
|
||||||
{
|
{
|
||||||
case $1 in
|
if [[ "$1" = /* ]] ; then
|
||||||
|
RESOURCE_PATH="$1"
|
||||||
|
else
|
||||||
|
RESOURCE_PATH="${PODS_ROOT}/$1"
|
||||||
|
fi
|
||||||
|
if [[ ! -e "$RESOURCE_PATH" ]] ; then
|
||||||
|
cat << EOM
|
||||||
|
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
|
||||||
|
EOM
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
case $RESOURCE_PATH in
|
||||||
*.storyboard)
|
*.storyboard)
|
||||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
|
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT}"
|
||||||
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
|
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}"
|
||||||
;;
|
;;
|
||||||
*.xib)
|
*.xib)
|
||||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
|
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
|
||||||
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
|
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
|
||||||
;;
|
;;
|
||||||
*.framework)
|
*.framework)
|
||||||
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
echo "rsync -av $RESOURCE_PATH ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
rsync -av "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||||
;;
|
;;
|
||||||
*.xcdatamodel)
|
*.xcdatamodel)
|
||||||
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
|
echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
|
||||||
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
|
xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
|
||||||
;;
|
;;
|
||||||
*.xcdatamodeld)
|
*.xcdatamodeld)
|
||||||
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
|
echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
|
||||||
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
|
xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
|
||||||
;;
|
;;
|
||||||
*.xcmappingmodel)
|
*.xcmappingmodel)
|
||||||
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
|
echo "xcrun mapc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
|
||||||
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
|
xcrun mapc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
|
||||||
;;
|
;;
|
||||||
*.xcassets)
|
*.xcassets)
|
||||||
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
|
ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
|
||||||
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
||||||
;;
|
;;
|
||||||
/*)
|
|
||||||
echo "$1"
|
|
||||||
echo "$1" >> "$RESOURCES_TO_COPY"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "${PODS_ROOT}/$1"
|
echo "$RESOURCE_PATH"
|
||||||
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
|
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
if [[ "${ACTION}" == "install" ]]; then
|
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
|
||||||
|
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
fi
|
fi
|
||||||
rm -f "$RESOURCES_TO_COPY"
|
rm -f "$RESOURCES_TO_COPY"
|
||||||
@ -89,5 +98,5 @@ then
|
|||||||
fi
|
fi
|
||||||
done <<<"$OTHER_XCASSETS"
|
done <<<"$OTHER_XCASSETS"
|
||||||
|
|
||||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH"
|
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/FBSnapshotTestCase.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/NSString_Helper.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -ObjC -framework "FBSnapshotTestCase" -framework "NSString_Helper"
|
OTHER_LDFLAGS = $(inherited) -framework "FBSnapshotTestCase" -framework "NSString_Helper"
|
||||||
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
|
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Tests
|
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Tests
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
@ -1,9 +1,8 @@
|
|||||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH"
|
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/FBSnapshotTestCase.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/NSString_Helper.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -ObjC -framework "FBSnapshotTestCase" -framework "NSString_Helper"
|
OTHER_LDFLAGS = $(inherited) -framework "FBSnapshotTestCase" -framework "NSString_Helper"
|
||||||
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
|
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Tests
|
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-NSString-Helper_Tests
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
@ -1,6 +1,14 @@
|
|||||||
|
#
|
||||||
|
# Be sure to run `pod lib lint NSString-Helper.podspec' to ensure this is a
|
||||||
|
# valid spec before submitting.
|
||||||
|
#
|
||||||
|
# Any lines starting with a # are optional, but their use is encouraged
|
||||||
|
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
|
||||||
|
#
|
||||||
|
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = "NSString-Helper"
|
s.name = "NSString-Helper"
|
||||||
s.version = "1.0.1"
|
s.version = "1.0.2"
|
||||||
s.summary = "NSString-Helper is usefull helper to validate email NSString"
|
s.summary = "NSString-Helper is usefull helper to validate email NSString"
|
||||||
s.homepage = "https://github.com/giuseppenucifora/NSString-Helper"
|
s.homepage = "https://github.com/giuseppenucifora/NSString-Helper"
|
||||||
s.license = 'MIT'
|
s.license = 'MIT'
|
||||||
@ -10,7 +18,7 @@ Pod::Spec.new do |s|
|
|||||||
s.requires_arc = true
|
s.requires_arc = true
|
||||||
|
|
||||||
|
|
||||||
s.platform = :ios, '7.0'
|
s.platform = :ios, '8.0'
|
||||||
s.requires_arc = true
|
s.requires_arc = true
|
||||||
|
|
||||||
s.source_files = 'NSString-Helper/*.{h,m}'
|
s.source_files = 'NSString-Helper/*.{h,m}'
|
||||||
|
|||||||
@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
- (BOOL) isNumeric;
|
- (BOOL) isNumeric;
|
||||||
|
|
||||||
|
- (BOOL) isValidPhoneNumber;
|
||||||
|
|
||||||
- (BOOL) isValidUrl;
|
- (BOOL) isValidUrl;
|
||||||
|
|
||||||
- (BOOL) isValidTaxCode;
|
- (BOOL) isValidTaxCode;
|
||||||
|
|||||||
@ -28,6 +28,22 @@
|
|||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL) isValidPhoneNumber {
|
||||||
|
|
||||||
|
NSError *error = NULL;
|
||||||
|
NSDataDetector *detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypePhoneNumber error:&error];
|
||||||
|
NSArray *matches = [detector matchesInString:self options:0 range:NSMakeRange(0, [self length])];
|
||||||
|
|
||||||
|
if (matches != nil) {
|
||||||
|
for (NSTextCheckingResult *match in matches) {
|
||||||
|
if ([match resultType] == NSTextCheckingTypePhoneNumber) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL) isValidUrl {
|
- (BOOL) isValidUrl {
|
||||||
NSString *urlRegEx =
|
NSString *urlRegEx =
|
||||||
@"(http|https)://((\\w)*|([0-9]*)|([-|_])*)+([\\.|/]((\\w)*|([0-9]*)|([-|_])*))+";
|
@"(http|https)://((\\w)*|([0-9]*)|([-|_])*)+([\\.|/]((\\w)*|([0-9]*)|([-|_])*))+";
|
||||||
|
|||||||
@ -17,19 +17,20 @@ NSString-Helper is available through [CocoaPods](http://cocoapods.org). To insta
|
|||||||
it, simply add the following line to your Podfile:
|
it, simply add the following line to your Podfile:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
pod 'NSString-Helper' , :git => 'https://github.com/giuseppenucifora/NSString-Helper.git'
|
|
||||||
|
|
||||||
OR
|
|
||||||
|
|
||||||
pod 'NSString-Helper'
|
pod 'NSString-Helper'
|
||||||
```
|
```
|
||||||
##Usage
|
##Usage
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
|
|
||||||
|
#import <NSString-Helper/NSString+Helper.h>
|
||||||
|
|
||||||
NSString *str = @"testCode";
|
NSString *str = @"testCode";
|
||||||
|
|
||||||
NSLog(@"%@",[NSNumber numberWithBool:[str isNumeric]]);
|
NSLog(@"%@",[NSNumber numberWithBool:[str isNumeric]]);
|
||||||
|
|
||||||
|
NSLog(@"%@",[NSNumber numberWithBool:[str isValidPhoneNumber]]);
|
||||||
|
|
||||||
NSLog(@"%@",[NSNumber numberWithBool:[str isValidEmail]]);
|
NSLog(@"%@",[NSNumber numberWithBool:[str isValidEmail]]);
|
||||||
|
|
||||||
NSLog(@"%@",[NSNumber numberWithBool:[str isValidUrl]]);
|
NSLog(@"%@",[NSNumber numberWithBool:[str isValidUrl]]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user