- Fix present picker controller
This commit is contained in:
1 parent
2aa49f6ad1
commit
5974642e25
277 files changed
+14486
-11664
No files matched your search
@@ -21,9 +21,9 @@
|
|||||||
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 */; };
|
||||||
681785911C69DCB50032DAAC /* PNImagePickerViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 681785901C69DCB50032DAAC /* PNImagePickerViewController.framework */; };
|
681785911C69DCB50032DAAC /* PNImagePickerViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 681785901C69DCB50032DAAC /* PNImagePickerViewController.framework */; };
|
||||||
7D97D76088572AF45812187E /* Pods_PNImagePickerViewController_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4328521B225C017B57B0EA26 /* Pods_PNImagePickerViewController_Tests.framework */; };
|
|
||||||
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
|
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
|
||||||
D6C71C75B8F5800EC9990F14 /* Pods_PNImagePickerViewController_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 685260EDF68D7C851442C12E /* Pods_PNImagePickerViewController_Example.framework */; };
|
AE78532B104C86CFD7E59E56 /* libPods-PNImagePickerViewController_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C6AEC746978DFB326EAAA7FF /* libPods-PNImagePickerViewController_Tests.a */; };
|
||||||
|
DC5F4864BF4E2B1C54F620F6 /* libPods-PNImagePickerViewController_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C80B5FA595CB4977C47CBE3 /* libPods-PNImagePickerViewController_Example.a */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@@ -37,9 +37,9 @@
|
|||||||
/* End PBXContainerItemProxy section */
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
12535CEF396FF4D6369EA5C0 /* Pods-PNImagePickerViewController_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNImagePickerViewController_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PNImagePickerViewController_Tests/Pods-PNImagePickerViewController_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
2A510C8BD6FA22FF4BF841CC /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
2A510C8BD6FA22FF4BF841CC /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||||
4328521B225C017B57B0EA26 /* Pods_PNImagePickerViewController_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PNImagePickerViewController_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
43986E6CA155C636B098FB5C /* Pods-PNImagePickerViewController_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNImagePickerViewController_Tests.debug.xcconfig"; path = "Target Support Files/Pods-PNImagePickerViewController_Tests/Pods-PNImagePickerViewController_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
5C80B5FA595CB4977C47CBE3 /* libPods-PNImagePickerViewController_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PNImagePickerViewController_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
6003F58A195388D20070C39A /* PNImagePickerViewController_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PNImagePickerViewController_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
6003F58A195388D20070C39A /* PNImagePickerViewController_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PNImagePickerViewController_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; };
|
||||||
@@ -60,13 +60,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>"; };
|
||||||
681785901C69DCB50032DAAC /* PNImagePickerViewController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PNImagePickerViewController.framework; path = "Pods/../build/Debug-iphoneos/PNImagePickerViewController.framework"; sourceTree = "<group>"; };
|
681785901C69DCB50032DAAC /* PNImagePickerViewController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PNImagePickerViewController.framework; path = "Pods/../build/Debug-iphoneos/PNImagePickerViewController.framework"; sourceTree = "<group>"; };
|
||||||
685260EDF68D7C851442C12E /* Pods_PNImagePickerViewController_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PNImagePickerViewController_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
86D18E23BB421419B8132D08 /* Pods-PNImagePickerViewController_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNImagePickerViewController_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PNImagePickerViewController_Example/Pods-PNImagePickerViewController_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>"; };
|
||||||
930DB7C275684056258BA5EF /* PNImagePickerViewController.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = PNImagePickerViewController.podspec; path = ../PNImagePickerViewController.podspec; sourceTree = "<group>"; };
|
930DB7C275684056258BA5EF /* PNImagePickerViewController.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = PNImagePickerViewController.podspec; path = ../PNImagePickerViewController.podspec; sourceTree = "<group>"; };
|
||||||
98D3978B62130F866F704B9C /* Pods-PNImagePickerViewController_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNImagePickerViewController_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-PNImagePickerViewController_Example/Pods-PNImagePickerViewController_Example.release.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
9DECFF91FBC10CAD6C7AEE1E /* Pods-PNImagePickerViewController_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNImagePickerViewController_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PNImagePickerViewController_Tests/Pods-PNImagePickerViewController_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
AD447568A76DA895F7B37A24 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
AD447568A76DA895F7B37A24 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
||||||
|
ADC9C57C00FD4B2D4EF4A32E /* Pods-PNImagePickerViewController_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNImagePickerViewController_Example.release.xcconfig"; path = "Target Support Files/Pods-PNImagePickerViewController_Example/Pods-PNImagePickerViewController_Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
C6AEC746978DFB326EAAA7FF /* libPods-PNImagePickerViewController_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PNImagePickerViewController_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
CB8F44A02F3C2331783D2F8C /* Pods-PNImagePickerViewController_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNImagePickerViewController_Tests.release.xcconfig"; path = "Target Support Files/Pods-PNImagePickerViewController_Tests/Pods-PNImagePickerViewController_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
EBA5C1654F9AF7E4A9AFC1DA /* Pods-PNImagePickerViewController_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNImagePickerViewController_Example.debug.xcconfig"; path = "Target Support Files/Pods-PNImagePickerViewController_Example/Pods-PNImagePickerViewController_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -78,7 +78,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 */,
|
||||||
D6C71C75B8F5800EC9990F14 /* Pods_PNImagePickerViewController_Example.framework in Frameworks */,
|
DC5F4864BF4E2B1C54F620F6 /* libPods-PNImagePickerViewController_Example.a in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -89,7 +89,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 */,
|
||||||
7D97D76088572AF45812187E /* Pods_PNImagePickerViewController_Tests.framework in Frameworks */,
|
AE78532B104C86CFD7E59E56 /* libPods-PNImagePickerViewController_Tests.a in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
6003F5B5195388D20070C39A /* Tests */,
|
6003F5B5195388D20070C39A /* Tests */,
|
||||||
6003F58C195388D20070C39A /* Frameworks */,
|
6003F58C195388D20070C39A /* Frameworks */,
|
||||||
6003F58B195388D20070C39A /* Products */,
|
6003F58B195388D20070C39A /* Products */,
|
||||||
9BA892B7D07729CC69D18118 /* Pods */,
|
61B7F4C46763F303A5BF4642 /* Pods */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@@ -125,8 +125,8 @@
|
|||||||
6003F58F195388D20070C39A /* CoreGraphics.framework */,
|
6003F58F195388D20070C39A /* CoreGraphics.framework */,
|
||||||
6003F591195388D20070C39A /* UIKit.framework */,
|
6003F591195388D20070C39A /* UIKit.framework */,
|
||||||
6003F5AF195388D20070C39A /* XCTest.framework */,
|
6003F5AF195388D20070C39A /* XCTest.framework */,
|
||||||
685260EDF68D7C851442C12E /* Pods_PNImagePickerViewController_Example.framework */,
|
5C80B5FA595CB4977C47CBE3 /* libPods-PNImagePickerViewController_Example.a */,
|
||||||
4328521B225C017B57B0EA26 /* Pods_PNImagePickerViewController_Tests.framework */,
|
C6AEC746978DFB326EAAA7FF /* libPods-PNImagePickerViewController_Tests.a */,
|
||||||
);
|
);
|
||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -186,15 +186,16 @@
|
|||||||
name = "Podspec Metadata";
|
name = "Podspec Metadata";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
9BA892B7D07729CC69D18118 /* Pods */ = {
|
61B7F4C46763F303A5BF4642 /* Pods */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
86D18E23BB421419B8132D08 /* Pods-PNImagePickerViewController_Example.debug.xcconfig */,
|
EBA5C1654F9AF7E4A9AFC1DA /* Pods-PNImagePickerViewController_Example.debug.xcconfig */,
|
||||||
98D3978B62130F866F704B9C /* Pods-PNImagePickerViewController_Example.release.xcconfig */,
|
ADC9C57C00FD4B2D4EF4A32E /* Pods-PNImagePickerViewController_Example.release.xcconfig */,
|
||||||
9DECFF91FBC10CAD6C7AEE1E /* Pods-PNImagePickerViewController_Tests.debug.xcconfig */,
|
43986E6CA155C636B098FB5C /* Pods-PNImagePickerViewController_Tests.debug.xcconfig */,
|
||||||
12535CEF396FF4D6369EA5C0 /* Pods-PNImagePickerViewController_Tests.release.xcconfig */,
|
CB8F44A02F3C2331783D2F8C /* Pods-PNImagePickerViewController_Tests.release.xcconfig */,
|
||||||
);
|
);
|
||||||
name = Pods;
|
name = Pods;
|
||||||
|
path = Pods;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
@@ -204,12 +205,10 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "PNImagePickerViewController_Example" */;
|
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "PNImagePickerViewController_Example" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
F8D96CF8CF3D374B5AAE33C4 /* Check Pods Manifest.lock */,
|
2C6565F5C43756D0430E8CA7 /* [CP] Check Pods Manifest.lock */,
|
||||||
6003F586195388D20070C39A /* Sources */,
|
6003F586195388D20070C39A /* Sources */,
|
||||||
6003F587195388D20070C39A /* Frameworks */,
|
6003F587195388D20070C39A /* Frameworks */,
|
||||||
6003F588195388D20070C39A /* Resources */,
|
6003F588195388D20070C39A /* Resources */,
|
||||||
B94FCDE98F285449578D9F34 /* Embed Pods Frameworks */,
|
|
||||||
56476F9757949999164002B1 /* Copy Pods Resources */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -224,12 +223,10 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "PNImagePickerViewController_Tests" */;
|
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "PNImagePickerViewController_Tests" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
2FD43162D7B4455C62B23FFC /* Check Pods Manifest.lock */,
|
3C97CC20A31B0FA9B8E46167 /* [CP] Check Pods Manifest.lock */,
|
||||||
6003F5AA195388D20070C39A /* Sources */,
|
6003F5AA195388D20070C39A /* Sources */,
|
||||||
6003F5AB195388D20070C39A /* Frameworks */,
|
6003F5AB195388D20070C39A /* Frameworks */,
|
||||||
6003F5AC195388D20070C39A /* Resources */,
|
6003F5AC195388D20070C39A /* Resources */,
|
||||||
6C7D9A9333266674130B4B6D /* Embed Pods Frameworks */,
|
|
||||||
B6A2E7AB4CD0217BA75EC551 /* Copy Pods Resources */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -251,6 +248,9 @@
|
|||||||
LastUpgradeCheck = 0720;
|
LastUpgradeCheck = 0720;
|
||||||
ORGANIZATIONNAME = "Giuseppe Nucifora";
|
ORGANIZATIONNAME = "Giuseppe Nucifora";
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
|
6003F589195388D20070C39A = {
|
||||||
|
DevelopmentTeam = 825G85A28E;
|
||||||
|
};
|
||||||
6003F5AD195388D20070C39A = {
|
6003F5AD195388D20070C39A = {
|
||||||
TestTargetID = 6003F589195388D20070C39A;
|
TestTargetID = 6003F589195388D20070C39A;
|
||||||
};
|
};
|
||||||
@@ -297,94 +297,48 @@
|
|||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
2FD43162D7B4455C62B23FFC /* Check Pods Manifest.lock */ = {
|
2C6565F5C43756D0430E8CA7 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
);
|
);
|
||||||
inputPaths = (
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputFileListPaths = (
|
||||||
);
|
);
|
||||||
name = "Check Pods Manifest.lock";
|
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-PNImagePickerViewController_Example-checkManifestLockResult.txt",
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
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";
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
56476F9757949999164002B1 /* Copy Pods Resources */ = {
|
3C97CC20A31B0FA9B8E46167 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
);
|
);
|
||||||
inputPaths = (
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputFileListPaths = (
|
||||||
);
|
);
|
||||||
name = "Copy Pods Resources";
|
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-PNImagePickerViewController_Tests-checkManifestLockResult.txt",
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNImagePickerViewController_Example/Pods-PNImagePickerViewController_Example-resources.sh\"\n";
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
6C7D9A9333266674130B4B6D /* Embed Pods Frameworks */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "Embed Pods Frameworks";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNImagePickerViewController_Tests/Pods-PNImagePickerViewController_Tests-frameworks.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
B6A2E7AB4CD0217BA75EC551 /* 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-PNImagePickerViewController_Tests/Pods-PNImagePickerViewController_Tests-resources.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
B94FCDE98F285449578D9F34 /* Embed Pods Frameworks */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "Embed Pods Frameworks";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNImagePickerViewController_Example/Pods-PNImagePickerViewController_Example-frameworks.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
F8D96CF8CF3D374B5AAE33C4 /* 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;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
@@ -513,10 +467,11 @@
|
|||||||
};
|
};
|
||||||
6003F5C0195388D20070C39A /* Debug */ = {
|
6003F5C0195388D20070C39A /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 86D18E23BB421419B8132D08 /* Pods-PNImagePickerViewController_Example.debug.xcconfig */;
|
baseConfigurationReference = EBA5C1654F9AF7E4A9AFC1DA /* Pods-PNImagePickerViewController_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;
|
||||||
|
DEVELOPMENT_TEAM = 825G85A28E;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/build/Debug-iphoneos",
|
"$(PROJECT_DIR)/build/Debug-iphoneos",
|
||||||
@@ -533,10 +488,11 @@
|
|||||||
};
|
};
|
||||||
6003F5C1195388D20070C39A /* Release */ = {
|
6003F5C1195388D20070C39A /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 98D3978B62130F866F704B9C /* Pods-PNImagePickerViewController_Example.release.xcconfig */;
|
baseConfigurationReference = ADC9C57C00FD4B2D4EF4A32E /* Pods-PNImagePickerViewController_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;
|
||||||
|
DEVELOPMENT_TEAM = 825G85A28E;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/build/Debug-iphoneos",
|
"$(PROJECT_DIR)/build/Debug-iphoneos",
|
||||||
@@ -553,7 +509,7 @@
|
|||||||
};
|
};
|
||||||
6003F5C3195388D20070C39A /* Debug */ = {
|
6003F5C3195388D20070C39A /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 9DECFF91FBC10CAD6C7AEE1E /* Pods-PNImagePickerViewController_Tests.debug.xcconfig */;
|
baseConfigurationReference = 43986E6CA155C636B098FB5C /* Pods-PNImagePickerViewController_Tests.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
@@ -577,7 +533,7 @@
|
|||||||
};
|
};
|
||||||
6003F5C4195388D20070C39A /* Release */ = {
|
6003F5C4195388D20070C39A /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 12535CEF396FF4D6369EA5C0 /* Pods-PNImagePickerViewController_Tests.release.xcconfig */;
|
baseConfigurationReference = CB8F44A02F3C2331783D2F8C /* Pods-PNImagePickerViewController_Tests.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -43,5 +43,11 @@
|
|||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>NSCameraUsageDescription</key>
|
||||||
|
<string>L'app vorrebbe accedere alle foto</string>
|
||||||
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
<string>L'app vorrebbe accedere alle foto</string>
|
||||||
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
|
<string>L'app vorrebbe accedere al microfono</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
+1
-2
@@ -1,5 +1,5 @@
|
|||||||
source 'https://github.com/CocoaPods/Specs.git'
|
source 'https://github.com/CocoaPods/Specs.git'
|
||||||
use_frameworks!
|
platform :ios, '9.0'
|
||||||
|
|
||||||
target 'PNImagePickerViewController_Example' do
|
target 'PNImagePickerViewController_Example' do
|
||||||
pod 'PNImagePickerViewController', :path => '../'
|
pod 'PNImagePickerViewController', :path => '../'
|
||||||
@@ -11,6 +11,5 @@ target 'PNImagePickerViewController_Tests' do
|
|||||||
|
|
||||||
pod 'Specta'
|
pod 'Specta'
|
||||||
pod 'Expecta'
|
pod 'Expecta'
|
||||||
pod 'FBSnapshotTestCase'
|
|
||||||
pod 'Expecta+Snapshots'
|
pod 'Expecta+Snapshots'
|
||||||
end
|
end
|
||||||
+28
-22
@@ -1,40 +1,46 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- DGActivityIndicatorView (2.0)
|
- DGActivityIndicatorView (2.1.1)
|
||||||
- Expecta (1.0.5)
|
- Expecta (1.0.6)
|
||||||
- Expecta+Snapshots (3.0.0):
|
- "Expecta+Snapshots (3.1.1)":
|
||||||
- Expecta (~> 1.0)
|
- Expecta (~> 1.0)
|
||||||
- FBSnapshotTestCase/Core (~> 2.0)
|
- FBSnapshotTestCase/Core (~> 2.0)
|
||||||
- Specta (~> 1.0)
|
- Specta (~> 1.0)
|
||||||
- FBSnapshotTestCase (2.1.0):
|
- FBSnapshotTestCase/Core (2.1.4)
|
||||||
- FBSnapshotTestCase/SwiftSupport (= 2.1.0)
|
- PNImagePickerViewController (1.0):
|
||||||
- FBSnapshotTestCase/Core (2.1.0)
|
|
||||||
- FBSnapshotTestCase/SwiftSupport (2.1.0):
|
|
||||||
- FBSnapshotTestCase/Core
|
|
||||||
- PNImagePickerViewController (0.1.6):
|
|
||||||
- DGActivityIndicatorView
|
- DGActivityIndicatorView
|
||||||
- PureLayout
|
- PureLayout
|
||||||
- PureLayout (3.0.1)
|
- PureLayout (3.1.4)
|
||||||
- Specta (1.0.5)
|
- Specta (1.0.7)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- Expecta
|
- Expecta
|
||||||
- Expecta+Snapshots
|
- "Expecta+Snapshots"
|
||||||
- FBSnapshotTestCase
|
|
||||||
- PNImagePickerViewController (from `../`)
|
- PNImagePickerViewController (from `../`)
|
||||||
- PureLayout
|
- PureLayout
|
||||||
- Specta
|
- Specta
|
||||||
|
|
||||||
|
SPEC REPOS:
|
||||||
|
https://github.com/cocoapods/specs.git:
|
||||||
|
- DGActivityIndicatorView
|
||||||
|
- Expecta
|
||||||
|
- "Expecta+Snapshots"
|
||||||
|
- FBSnapshotTestCase
|
||||||
|
- PureLayout
|
||||||
|
- Specta
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
PNImagePickerViewController:
|
PNImagePickerViewController:
|
||||||
:path: ../
|
:path: "../"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
DGActivityIndicatorView: 52875b025a6ccf6a431a905285c12e2bb95eb559
|
DGActivityIndicatorView: ff2c76073d79692f724863c8dd38685866a03cb6
|
||||||
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5
|
||||||
Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516
|
"Expecta+Snapshots": dcff217eef506dabd6dfdc7864ea2da321fafbb8
|
||||||
FBSnapshotTestCase: 366ecd378511d7716c79991cd8067d1eed23578d
|
FBSnapshotTestCase: 094f9f314decbabe373b87cc339bea235a63e07a
|
||||||
PNImagePickerViewController: 0848e21228883cb9ed88d1acda011343874159bf
|
PNImagePickerViewController: ec5feb9bd69e25a02dd13423ba2f27aa07812dbf
|
||||||
PureLayout: f35f5384c9c4e4479df041dbe33ad7577b71ddfb
|
PureLayout: f08c01b8dec00bb14a1fefa3de4c7d9c265df85e
|
||||||
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
|
||||||
|
|
||||||
COCOAPODS: 0.39.0
|
PODFILE CHECKSUM: d21e7aa1109583b38a752038983d180af70f28d4
|
||||||
|
|
||||||
|
COCOAPODS: 1.6.0
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// DGActivityIndicatorAnimation.h
|
||||||
|
// DGActivityIndicatorExample
|
||||||
|
//
|
||||||
|
// Created by Danil Gontovnik on 8/10/16.
|
||||||
|
// Copyright © 2016 Danil Gontovnik. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
#import "DGActivityIndicatorAnimationProtocol.h"
|
||||||
|
|
||||||
|
@interface DGActivityIndicatorAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
||||||
|
|
||||||
|
- (CABasicAnimation *)createBasicAnimationWithKeyPath:(NSString *)keyPath;
|
||||||
|
- (CAKeyframeAnimation *)createKeyframeAnimationWithKeyPath:(NSString *)keyPath;
|
||||||
|
- (CAAnimationGroup *)createAnimationGroup;
|
||||||
|
|
||||||
|
@end
|
||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
//
|
||||||
|
// DGActivityIndicatorAnimation.m
|
||||||
|
// DGActivityIndicatorExample
|
||||||
|
//
|
||||||
|
// Created by Danil Gontovnik on 8/10/16.
|
||||||
|
// Copyright © 2016 Danil Gontovnik. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
|
@implementation DGActivityIndicatorAnimation
|
||||||
|
|
||||||
|
- (CABasicAnimation *)createBasicAnimationWithKeyPath:(NSString *)keyPath {
|
||||||
|
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:keyPath];
|
||||||
|
animation.removedOnCompletion = NO;
|
||||||
|
return animation;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CAKeyframeAnimation *)createKeyframeAnimationWithKeyPath:(NSString *)keyPath {
|
||||||
|
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:keyPath];
|
||||||
|
animation.removedOnCompletion = NO;
|
||||||
|
return animation;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CAAnimationGroup *)createAnimationGroup {
|
||||||
|
CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
|
||||||
|
animationGroup.removedOnCompletion = NO;
|
||||||
|
return animationGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setupAnimationInLayer:(CALayer *)layer withSize:(CGSize)size tintColor:(UIColor *)tintColor {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallBeatAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallBeatAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -19,21 +19,21 @@
|
|||||||
CGFloat y = (layer.bounds.size.height - circleSize) / 2;
|
CGFloat y = (layer.bounds.size.height - circleSize) / 2;
|
||||||
|
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.duration = duration;
|
scaleAnimation.duration = duration;
|
||||||
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
scaleAnimation.values = @[@1.0f, @0.75f, @1.0f];
|
scaleAnimation.values = @[@1.0f, @0.75f, @1.0f];
|
||||||
|
|
||||||
// Opacity animation
|
// Opacity animation
|
||||||
CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
CAKeyframeAnimation *opacityAnimation = [self createKeyframeAnimationWithKeyPath:@"opacity"];
|
||||||
|
|
||||||
opacityAnimation.duration = duration;
|
opacityAnimation.duration = duration;
|
||||||
opacityAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
opacityAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
opacityAnimation.values = @[@1.0f, @0.2f, @1.0f];
|
opacityAnimation.values = @[@1.0f, @0.2f, @1.0f];
|
||||||
|
|
||||||
// Aniamtion
|
// Aniamtion
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
animation.animations = @[scaleAnimation, opacityAnimation];
|
animation.animations = @[scaleAnimation, opacityAnimation];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallClipRotateAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallClipRotateAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -14,7 +14,7 @@
|
|||||||
CGFloat duration = 0.75f;
|
CGFloat duration = 0.75f;
|
||||||
|
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
||||||
[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.6f, 0.6f, 1.0f)],
|
[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.6f, 0.6f, 1.0f)],
|
||||||
@@ -22,13 +22,13 @@
|
|||||||
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
|
|
||||||
// Rotate animation
|
// Rotate animation
|
||||||
CAKeyframeAnimation *rotateAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
|
CAKeyframeAnimation *rotateAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.rotation.z"];
|
||||||
|
|
||||||
rotateAnimation.values = @[@0, @M_PI, @(2 * M_PI)];
|
rotateAnimation.values = @[@0, @M_PI, @(2 * M_PI)];
|
||||||
rotateAnimation.keyTimes = scaleAnimation.keyTimes;
|
rotateAnimation.keyTimes = scaleAnimation.keyTimes;
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[scaleAnimation, rotateAnimation];
|
animation.animations = @[scaleAnimation, rotateAnimation];
|
||||||
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
|
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallClipRotateMultipleAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallClipRotateMultipleAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
- (CAAnimation *)createAnimationInDuration:(CGFloat) duration withTimingFunction:(CAMediaTimingFunction *) timingFunction reverse:(BOOL) reverse {
|
- (CAAnimation *)createAnimationInDuration:(CGFloat) duration withTimingFunction:(CAMediaTimingFunction *) timingFunction reverse:(BOOL) reverse {
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
scaleAnimation.timingFunctions = @[timingFunction, timingFunction];
|
scaleAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Rotate animation
|
// Rotate animation
|
||||||
CAKeyframeAnimation *rotateAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
|
CAKeyframeAnimation *rotateAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.rotation.z"];
|
||||||
|
|
||||||
if (!reverse) {
|
if (!reverse) {
|
||||||
rotateAnimation.values = @[@0, @M_PI, @(2 * M_PI)];
|
rotateAnimation.values = @[@0, @M_PI, @(2 * M_PI)];
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
rotateAnimation.timingFunctions = @[timingFunction, timingFunction];
|
rotateAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[scaleAnimation, rotateAnimation];
|
animation.animations = @[scaleAnimation, rotateAnimation];
|
||||||
animation.repeatCount = HUGE_VALF;
|
animation.repeatCount = HUGE_VALF;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallClipRotatePulseAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallClipRotatePulseAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+4
-4
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
// Small circle
|
// Small circle
|
||||||
{
|
{
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.keyTimes = @[@0.0f, @0.3f, @1.0f];
|
scaleAnimation.keyTimes = @[@0.0f, @0.3f, @1.0f];
|
||||||
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
// Big circle
|
// Big circle
|
||||||
{
|
{
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
scaleAnimation.timingFunctions = @[timingFunction, timingFunction];
|
scaleAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Rotate animation
|
// Rotate animation
|
||||||
CAKeyframeAnimation *rotateAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
|
CAKeyframeAnimation *rotateAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.rotation.z"];
|
||||||
|
|
||||||
rotateAnimation.values = @[@0, @M_PI, @(2 * M_PI)];
|
rotateAnimation.values = @[@0, @M_PI, @(2 * M_PI)];
|
||||||
rotateAnimation.keyTimes = scaleAnimation.keyTimes;
|
rotateAnimation.keyTimes = scaleAnimation.keyTimes;
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
rotateAnimation.timingFunctions = @[timingFunction, timingFunction];
|
rotateAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[scaleAnimation, rotateAnimation];
|
animation.animations = @[scaleAnimation, rotateAnimation];
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallGridBeatAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallGridBeatAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"opacity"];
|
||||||
|
|
||||||
animation.beginTime = CACurrentMediaTime();
|
animation.beginTime = CACurrentMediaTime();
|
||||||
animation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
animation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallGridPulseAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallGridPulseAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -20,21 +20,21 @@
|
|||||||
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
||||||
|
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
scaleAnimation.values = @[@1.0f, @0.5f, @1.0f];
|
scaleAnimation.values = @[@1.0f, @0.5f, @1.0f];
|
||||||
scaleAnimation.timingFunctions = @[timingFunction, timingFunction];
|
scaleAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
CAKeyframeAnimation *opacityAnimation = [self createKeyframeAnimationWithKeyPath:@"opacity"];
|
||||||
|
|
||||||
opacityAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
opacityAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
opacityAnimation.values = @[@1.0f, @0.7f, @1.0f];
|
opacityAnimation.values = @[@1.0f, @0.7f, @1.0f];
|
||||||
opacityAnimation.timingFunctions = @[timingFunction, timingFunction];
|
opacityAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[scaleAnimation, opacityAnimation];
|
animation.animations = @[scaleAnimation, opacityAnimation];
|
||||||
animation.beginTime = CACurrentMediaTime();
|
animation.beginTime = CACurrentMediaTime();
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallPulseAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallPulseAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
NSArray *timeBegins = @[@0.12f, @0.24f, @0.36f];
|
NSArray *timeBegins = @[@0.12f, @0.24f, @0.36f];
|
||||||
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.2f :0.68f :0.18f :1.08f];
|
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.2f :0.68f :0.18f :1.08f];
|
||||||
|
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
|
|
||||||
animation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
animation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
||||||
[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.3f, 0.3f, 1.0f)],
|
[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.3f, 0.3f, 1.0f)],
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallPulseSyncAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallPulseSyncAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
CAMediaTimingFunction *timingFunciton = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
CAMediaTimingFunction *timingFunciton = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.y"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"transform.translation.y"];
|
||||||
|
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f];
|
animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallRotateAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallRotateAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -16,7 +16,7 @@
|
|||||||
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.7f :-0.13f :0.22f :0.86f];
|
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.7f :-0.13f :0.22f :0.86f];
|
||||||
|
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
scaleAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
scaleAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 1.0f)],
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
scaleAnimation.timingFunctions = @[timingFunction, timingFunction];
|
scaleAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Rotate animation
|
// Rotate animation
|
||||||
CAKeyframeAnimation *rotateAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
|
CAKeyframeAnimation *rotateAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.rotation.z"];
|
||||||
|
|
||||||
rotateAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
rotateAnimation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
rotateAnimation.values = @[@0, @-M_PI, @(-2 * M_PI)];
|
rotateAnimation.values = @[@0, @-M_PI, @(-2 * M_PI)];
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
rotateAnimation.timingFunctions = @[timingFunction, timingFunction];
|
rotateAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[scaleAnimation, rotateAnimation];
|
animation.animations = @[scaleAnimation, rotateAnimation];
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallScaleAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallScaleAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -14,21 +14,21 @@
|
|||||||
CGFloat duration = 1.0f;
|
CGFloat duration = 1.0f;
|
||||||
|
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
|
CABasicAnimation *scaleAnimation = [self createBasicAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.duration = duration;
|
scaleAnimation.duration = duration;
|
||||||
scaleAnimation.fromValue = @0.0f;
|
scaleAnimation.fromValue = @0.0f;
|
||||||
scaleAnimation.toValue = @1.0f;
|
scaleAnimation.toValue = @1.0f;
|
||||||
|
|
||||||
// Opacity animation
|
// Opacity animation
|
||||||
CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
|
CABasicAnimation *opacityAnimation = [self createBasicAnimationWithKeyPath:@"opacity"];
|
||||||
|
|
||||||
opacityAnimation.duration = duration;
|
opacityAnimation.duration = duration;
|
||||||
opacityAnimation.fromValue = @1.0f;
|
opacityAnimation.fromValue = @1.0f;
|
||||||
opacityAnimation.toValue = @0.0f;
|
opacityAnimation.toValue = @0.0f;
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[scaleAnimation, opacityAnimation];
|
animation.animations = @[scaleAnimation, opacityAnimation];
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallScaleMultipleAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallScaleMultipleAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -15,21 +15,21 @@
|
|||||||
NSArray *beginTimes = @[@0.0f, @0.2f, @0.4f];
|
NSArray *beginTimes = @[@0.0f, @0.2f, @0.4f];
|
||||||
|
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
|
CABasicAnimation *scaleAnimation = [self createBasicAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.duration = duration;
|
scaleAnimation.duration = duration;
|
||||||
scaleAnimation.fromValue = @0.0f;
|
scaleAnimation.fromValue = @0.0f;
|
||||||
scaleAnimation.toValue = @1.0f;
|
scaleAnimation.toValue = @1.0f;
|
||||||
|
|
||||||
// Opacity animation
|
// Opacity animation
|
||||||
CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
CAKeyframeAnimation *opacityAnimation = [self createKeyframeAnimationWithKeyPath:@"opacity"];
|
||||||
|
|
||||||
opacityAnimation.duration = duration;
|
opacityAnimation.duration = duration;
|
||||||
opacityAnimation.keyTimes = @[@0.0f, @0.05f, @1.0f];
|
opacityAnimation.keyTimes = @[@0.0f, @0.05f, @1.0f];
|
||||||
opacityAnimation.values = @[@0.0f, @1.0f, @0.0f];
|
opacityAnimation.values = @[@0.0f, @1.0f, @0.0f];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[scaleAnimation, opacityAnimation];
|
animation.animations = @[scaleAnimation, opacityAnimation];
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallScaleRippleAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallScaleRippleAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -15,7 +15,7 @@
|
|||||||
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.21f :0.53f :0.56f :0.8f];
|
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.21f :0.53f :0.56f :0.8f];
|
||||||
|
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.duration = duration;
|
scaleAnimation.duration = duration;
|
||||||
scaleAnimation.keyTimes = @[@0.0f, @0.7f];
|
scaleAnimation.keyTimes = @[@0.0f, @0.7f];
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
scaleAnimation.timingFunction = timingFunction;
|
scaleAnimation.timingFunction = timingFunction;
|
||||||
|
|
||||||
// Opacity animation
|
// Opacity animation
|
||||||
CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
CAKeyframeAnimation *opacityAnimation = [self createKeyframeAnimationWithKeyPath:@"opacity"];
|
||||||
|
|
||||||
opacityAnimation.duration = duration;
|
opacityAnimation.duration = duration;
|
||||||
opacityAnimation.keyTimes = @[@0.0f, @0.7f, @1.0f];
|
opacityAnimation.keyTimes = @[@0.0f, @0.7f, @1.0f];
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
opacityAnimation.timingFunctions = @[timingFunction, timingFunction];
|
opacityAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[scaleAnimation, opacityAnimation];
|
animation.animations = @[scaleAnimation, opacityAnimation];
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallScaleRippleMultipleAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallScaleRippleMultipleAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -16,7 +16,7 @@
|
|||||||
NSArray *timeOffsets = @[@0.0f, @0.2f, @0.4f];
|
NSArray *timeOffsets = @[@0.0f, @0.2f, @0.4f];
|
||||||
|
|
||||||
// Scale animation
|
// Scale animation
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.duration = duration;
|
scaleAnimation.duration = duration;
|
||||||
scaleAnimation.keyTimes = @[@0.0f, @0.7f];
|
scaleAnimation.keyTimes = @[@0.0f, @0.7f];
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
scaleAnimation.timingFunction = timingFunction;
|
scaleAnimation.timingFunction = timingFunction;
|
||||||
|
|
||||||
// Opacity animation
|
// Opacity animation
|
||||||
CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
CAKeyframeAnimation *opacityAnimation = [self createKeyframeAnimationWithKeyPath:@"opacity"];
|
||||||
|
|
||||||
opacityAnimation.duration = duration;
|
opacityAnimation.duration = duration;
|
||||||
opacityAnimation.keyTimes = @[@0.0f, @0.7f, @1.0f];
|
opacityAnimation.keyTimes = @[@0.0f, @0.7f, @1.0f];
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
opacityAnimation.timingFunctions = @[timingFunction, timingFunction];
|
opacityAnimation.timingFunctions = @[timingFunction, timingFunction];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[scaleAnimation, opacityAnimation];
|
animation.animations = @[scaleAnimation, opacityAnimation];
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 mRocker. All rights reserved.
|
// Copyright (c) 2015 mRocker. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallSpinFadeLoader : NSObject<DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallSpinFadeLoader : DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-4
@@ -26,14 +26,14 @@
|
|||||||
|
|
||||||
NSArray *beginTimes = @[@0, @0.12, @0.24, @0.36, @0.48, @0.6, @0.72, @0.84];
|
NSArray *beginTimes = @[@0, @0.12, @0.24, @0.36, @0.48, @0.6, @0.72, @0.84];
|
||||||
|
|
||||||
CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *scaleAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
scaleAnimation.keyTimes = @[@0, @0.5, @1];
|
scaleAnimation.keyTimes = @[@0, @0.5, @1];
|
||||||
scaleAnimation.values = @[@1, @0.4, @1];
|
scaleAnimation.values = @[@1, @0.4, @1];
|
||||||
scaleAnimation.duration = duration;
|
scaleAnimation.duration = duration;
|
||||||
|
|
||||||
|
|
||||||
CAKeyframeAnimation *opacityAnimaton = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
CAKeyframeAnimation *opacityAnimaton = [self createKeyframeAnimationWithKeyPath:@"opacity"];
|
||||||
|
|
||||||
|
|
||||||
opacityAnimaton.keyTimes = @[@0, @0.5, @1];
|
opacityAnimaton.keyTimes = @[@0, @0.5, @1];
|
||||||
@@ -43,12 +43,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
|
CAAnimationGroup *animationGroup = [self createAnimationGroup];;
|
||||||
animationGroup.animations = @[scaleAnimation, opacityAnimaton];
|
animationGroup.animations = @[scaleAnimation, opacityAnimaton];
|
||||||
animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
|
animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
|
||||||
animationGroup.duration = duration;
|
animationGroup.duration = duration;
|
||||||
animationGroup.repeatCount = HUGE;
|
animationGroup.repeatCount = HUGE;
|
||||||
animationGroup.removedOnCompletion = NO;
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallTrianglePathAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallTrianglePathAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
|
|
||||||
animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f];
|
animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f];
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallZigZagAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallZigZagAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
CGFloat deltaY = size.height / 2 - circleSize / 2;
|
CGFloat deltaY = size.height / 2 - circleSize / 2;
|
||||||
|
|
||||||
// Circle 1 animation
|
// Circle 1 animation
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
|
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f];
|
animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorBallZigZagDeflectAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorBallZigZagDeflectAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
CGFloat deltaY = size.height / 2 - circleSize / 2;
|
CGFloat deltaY = size.height / 2 - circleSize / 2;
|
||||||
|
|
||||||
// Circle 1 animation
|
// Circle 1 animation
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
|
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f];
|
animation.keyTimes = @[@0.0f, @0.33f, @0.66f, @1.0f];
|
||||||
|
|||||||
+2
-2
@@ -6,9 +6,9 @@
|
|||||||
// Copyright (c) 2015年 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015年 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorCookieTerminatorAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorCookieTerminatorAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+2
-4
@@ -42,8 +42,7 @@
|
|||||||
jawLayer.opacity = 1.0f;
|
jawLayer.opacity = 1.0f;
|
||||||
jawLayer.transform = CATransform3DMakeRotation((1.0f - 2.0f * i) * M_PI_4, 0.0f, 0.0f, 1.0f);
|
jawLayer.transform = CATransform3DMakeRotation((1.0f - 2.0f * i) * M_PI_4, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];
|
CABasicAnimation *transformAnimation = [self createBasicAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.removedOnCompletion = NO;
|
|
||||||
transformAnimation.beginTime = beginTime;
|
transformAnimation.beginTime = beginTime;
|
||||||
transformAnimation.duration = 0.3f;
|
transformAnimation.duration = 0.3f;
|
||||||
transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation((1.0f - 2.0f * i) * M_PI_4, 0.0f, 0.0f, 1.0f)];
|
transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation((1.0f - 2.0f * i) * M_PI_4, 0.0f, 0.0f, 1.0f)];
|
||||||
@@ -66,13 +65,12 @@
|
|||||||
cookieLayer.opacity = 1.0f;
|
cookieLayer.opacity = 1.0f;
|
||||||
cookieLayer.cornerRadius = cookieSize / 2.0f;
|
cookieLayer.cornerRadius = cookieSize / 2.0f;
|
||||||
|
|
||||||
CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];
|
CABasicAnimation *transformAnimation = [self createBasicAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.duration = 1.8f;
|
transformAnimation.duration = 1.8f;
|
||||||
transformAnimation.beginTime = beginTime - (i * transformAnimation.duration / 3.0f);
|
transformAnimation.beginTime = beginTime - (i * transformAnimation.duration / 3.0f);
|
||||||
transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f)];
|
transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f)];
|
||||||
transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-3.0f * (cookieSize + cookiePadding), 0.0f, 0.0f)];
|
transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-3.0f * (cookieSize + cookiePadding), 0.0f, 0.0f)];
|
||||||
transformAnimation.repeatCount = HUGE_VALF;
|
transformAnimation.repeatCount = HUGE_VALF;
|
||||||
transformAnimation.removedOnCompletion = NO;
|
|
||||||
transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear];
|
transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear];
|
||||||
|
|
||||||
[layer addSublayer:cookieLayer];
|
[layer addSublayer:cookieLayer];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorDoubleBounceAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorDoubleBounceAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-2
@@ -27,8 +27,7 @@
|
|||||||
circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f);
|
circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f);
|
||||||
circle.backgroundColor = tintColor.CGColor;
|
circle.backgroundColor = tintColor.CGColor;
|
||||||
|
|
||||||
CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *transformAnimation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.removedOnCompletion = NO;
|
|
||||||
transformAnimation.repeatCount = HUGE_VALF;
|
transformAnimation.repeatCount = HUGE_VALF;
|
||||||
transformAnimation.duration = 2.0f;
|
transformAnimation.duration = 2.0f;
|
||||||
transformAnimation.beginTime = beginTime - (1.0f * i);
|
transformAnimation.beginTime = beginTime - (1.0f * i);
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorFiveDotsAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorFiveDotsAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+2
-4
@@ -43,13 +43,12 @@
|
|||||||
CATransform3D t5 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f);
|
CATransform3D t5 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f);
|
||||||
t5 = CATransform3DScale(t5, 1.f, 1.0f, 0.0f);
|
t5 = CATransform3DScale(t5, 1.f, 1.0f, 0.0f);
|
||||||
|
|
||||||
CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *transformAnimation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.values = @[[NSValue valueWithCATransform3D:t1],
|
transformAnimation.values = @[[NSValue valueWithCATransform3D:t1],
|
||||||
[NSValue valueWithCATransform3D:t2],
|
[NSValue valueWithCATransform3D:t2],
|
||||||
[NSValue valueWithCATransform3D:t3],
|
[NSValue valueWithCATransform3D:t3],
|
||||||
[NSValue valueWithCATransform3D:t4],
|
[NSValue valueWithCATransform3D:t4],
|
||||||
[NSValue valueWithCATransform3D:t5]];
|
[NSValue valueWithCATransform3D:t5]];
|
||||||
transformAnimation.removedOnCompletion = NO;
|
|
||||||
transformAnimation.beginTime = beginTime;
|
transformAnimation.beginTime = beginTime;
|
||||||
transformAnimation.repeatCount = HUGE_VALF;
|
transformAnimation.repeatCount = HUGE_VALF;
|
||||||
transformAnimation.duration = 1.0f;
|
transformAnimation.duration = 1.0f;
|
||||||
@@ -79,13 +78,12 @@
|
|||||||
CATransform3D t4 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f);
|
CATransform3D t4 = CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f);
|
||||||
t4 = CATransform3DScale(t4, 0.3f, 0.3f, 0.0f);
|
t4 = CATransform3DScale(t4, 0.3f, 0.3f, 0.0f);
|
||||||
|
|
||||||
CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *transformAnimation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.values = @[[NSValue valueWithCATransform3D:t1],
|
transformAnimation.values = @[[NSValue valueWithCATransform3D:t1],
|
||||||
[NSValue valueWithCATransform3D:t2],
|
[NSValue valueWithCATransform3D:t2],
|
||||||
[NSValue valueWithCATransform3D:t3],
|
[NSValue valueWithCATransform3D:t3],
|
||||||
[NSValue valueWithCATransform3D:t4]];
|
[NSValue valueWithCATransform3D:t4]];
|
||||||
transformAnimation.keyTimes = @[@(0.0f), @(0.25f), @(0.75f), @(1.0f)];
|
transformAnimation.keyTimes = @[@(0.0f), @(0.25f), @(0.75f), @(1.0f)];
|
||||||
transformAnimation.removedOnCompletion = NO;
|
|
||||||
transformAnimation.beginTime = beginTime;
|
transformAnimation.beginTime = beginTime;
|
||||||
transformAnimation.repeatCount = HUGE_VALF;
|
transformAnimation.repeatCount = HUGE_VALF;
|
||||||
transformAnimation.duration = 1.0f;
|
transformAnimation.duration = 1.0f;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorLineScaleAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorLineScaleAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale.y"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"transform.scale.y"];
|
||||||
|
|
||||||
animation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
animation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
animation.values = @[@1.0f, @0.4f, @1.0f];
|
animation.values = @[@1.0f, @0.4f, @1.0f];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorLineScalePartyAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorLineScalePartyAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"transform.scale"];
|
||||||
|
|
||||||
animation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
animation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
animation.values = @[@1.0f, @0.5f, @1.0f];
|
animation.values = @[@1.0f, @0.5f, @1.0f];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorLineScalePulseOutAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorLineScalePulseOutAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale.y"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"transform.scale.y"];
|
||||||
|
|
||||||
animation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
animation.keyTimes = @[@0.0f, @0.5f, @1.0f];
|
||||||
animation.values = @[@1.0f, @0.4f, @1.0f];
|
animation.values = @[@1.0f, @0.4f, @1.0f];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorLineScalePulseOutRapidAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorLineScalePulseOutRapidAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
CGFloat y = (layer.bounds.size.height - size.height) / 2;
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale.y"];
|
CAKeyframeAnimation *animation = [self createKeyframeAnimationWithKeyPath:@"transform.scale.y"];
|
||||||
|
|
||||||
animation.keyTimes = @[@0.0f, @0.8f, @0.9f];
|
animation.keyTimes = @[@0.0f, @0.8f, @0.9f];
|
||||||
animation.values = @[@1.0f, @0.3f, @1.0f];
|
animation.values = @[@1.0f, @0.3f, @1.0f];
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorNineDotsAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorNineDotsAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-4
@@ -37,16 +37,15 @@
|
|||||||
circle.opacity = 1.0f;
|
circle.opacity = 1.0f;
|
||||||
circle.cornerRadius = circle.bounds.size.height / 2.0f;
|
circle.cornerRadius = circle.bounds.size.height / 2.0f;
|
||||||
|
|
||||||
CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *transformAnimation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5f, 0.5f, 0.0f)],
|
transformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5f, 0.5f, 0.0f)],
|
||||||
[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)],
|
[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)],
|
||||||
[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5f, 0.5f, 0.0f)]];
|
[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5f, 0.5f, 0.0f)]];
|
||||||
|
|
||||||
CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
CAKeyframeAnimation *opacityAnimation = [self createKeyframeAnimationWithKeyPath:@"opacity"];
|
||||||
opacityAnimation.values = @[@(0.5f), @(1.0f), @(0.5f)];
|
opacityAnimation.values = @[@(0.5f), @(1.0f), @(0.5f)];
|
||||||
|
|
||||||
CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
|
CAAnimationGroup *animationGroup = [self createAnimationGroup];;
|
||||||
animationGroup.removedOnCompletion = NO;
|
|
||||||
animationGroup.beginTime = beginTime;
|
animationGroup.beginTime = beginTime;
|
||||||
animationGroup.repeatCount = HUGE_VALF;
|
animationGroup.repeatCount = HUGE_VALF;
|
||||||
animationGroup.duration = [durations[i] doubleValue];
|
animationGroup.duration = [durations[i] doubleValue];
|
||||||
|
|||||||
+2
-2
@@ -6,9 +6,9 @@
|
|||||||
// Copyright (c) 2015年 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015年 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorRotatingSandglassAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorRotatingSandglassAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-2
@@ -31,8 +31,7 @@
|
|||||||
circle.shouldRasterize = YES;
|
circle.shouldRasterize = YES;
|
||||||
circle.rasterizationScale = [[UIScreen mainScreen] scale];
|
circle.rasterizationScale = [[UIScreen mainScreen] scale];
|
||||||
|
|
||||||
CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *transformAnimation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.removedOnCompletion = NO;
|
|
||||||
transformAnimation.repeatCount = HUGE_VALF;
|
transformAnimation.repeatCount = HUGE_VALF;
|
||||||
transformAnimation.duration = 0.8f;
|
transformAnimation.duration = 0.8f;
|
||||||
transformAnimation.beginTime = beginTime;
|
transformAnimation.beginTime = beginTime;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorRotatingSquaresAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorRotatingSquaresAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-2
@@ -30,8 +30,7 @@ static CGFloat degreesToRadians(CGFloat degrees) { return (degrees) / 180.0 * M_
|
|||||||
square.shouldRasterize = YES;
|
square.shouldRasterize = YES;
|
||||||
square.rasterizationScale = [[UIScreen mainScreen] scale];
|
square.rasterizationScale = [[UIScreen mainScreen] scale];
|
||||||
|
|
||||||
CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *transformAnimation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.removedOnCompletion = NO;
|
|
||||||
transformAnimation.duration = 1.6f;
|
transformAnimation.duration = 1.6f;
|
||||||
transformAnimation.beginTime = beginTime - (i * transformAnimation.duration / 2.0f);
|
transformAnimation.beginTime = beginTime - (i * transformAnimation.duration / 2.0f);
|
||||||
transformAnimation.repeatCount = HUGE_VALF;
|
transformAnimation.repeatCount = HUGE_VALF;
|
||||||
|
|||||||
+2
-2
@@ -6,9 +6,9 @@
|
|||||||
// Copyright (c) 2015年 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015年 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorRotatingTrigonAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorRotatingTrigonAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-2
@@ -38,8 +38,7 @@
|
|||||||
circle.shouldRasterize = YES;
|
circle.shouldRasterize = YES;
|
||||||
circle.rasterizationScale = [[UIScreen mainScreen] scale];
|
circle.rasterizationScale = [[UIScreen mainScreen] scale];
|
||||||
|
|
||||||
CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *transformAnimation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.removedOnCompletion = NO;
|
|
||||||
transformAnimation.repeatCount = HUGE_VALF;
|
transformAnimation.repeatCount = HUGE_VALF;
|
||||||
transformAnimation.duration = 2.0f;
|
transformAnimation.duration = 2.0f;
|
||||||
transformAnimation.beginTime = beginTime - (i * transformAnimation.duration / 3.0f);;
|
transformAnimation.beginTime = beginTime - (i * transformAnimation.duration / 3.0f);;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorThreeDotsAnimation : NSObject<DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorThreeDotsAnimation : DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-4
@@ -32,18 +32,17 @@
|
|||||||
circle.opacity = 1.0f;
|
circle.opacity = 1.0f;
|
||||||
circle.cornerRadius = circle.bounds.size.width / 2.0f;
|
circle.cornerRadius = circle.bounds.size.width / 2.0f;
|
||||||
|
|
||||||
CAKeyframeAnimation *tranformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *tranformAnimation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
|
|
||||||
tranformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5f, 0.5f, 0.0f)],
|
tranformAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5f, 0.5f, 0.0f)],
|
||||||
[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)]];
|
[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)]];
|
||||||
|
|
||||||
CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
|
CAKeyframeAnimation *opacityAnimation = [self createKeyframeAnimationWithKeyPath:@"opacity"];
|
||||||
|
|
||||||
opacityAnimation.values = @[@(0.25f), @(1.0f)];
|
opacityAnimation.values = @[@(0.25f), @(1.0f)];
|
||||||
|
|
||||||
CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
|
CAAnimationGroup *animationGroup = [self createAnimationGroup];;
|
||||||
|
|
||||||
animationGroup.removedOnCompletion = NO;
|
|
||||||
animationGroup.autoreverses = YES;
|
animationGroup.autoreverses = YES;
|
||||||
animationGroup.beginTime = beginTime;
|
animationGroup.beginTime = beginTime;
|
||||||
animationGroup.repeatCount = HUGE_VALF;
|
animationGroup.repeatCount = HUGE_VALF;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorTriangleSkewSpinAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorTriangleSkewSpinAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-3
@@ -17,7 +17,7 @@
|
|||||||
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.09f :0.57f :0.49f :0.9f];
|
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.09f :0.57f :0.49f :0.9f];
|
||||||
|
|
||||||
// Rotation x animation
|
// Rotation x animation
|
||||||
CAKeyframeAnimation *rotationXAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.x"];
|
CAKeyframeAnimation *rotationXAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.rotation.x"];
|
||||||
|
|
||||||
rotationXAnimation.duration = duration;
|
rotationXAnimation.duration = duration;
|
||||||
rotationXAnimation.keyTimes = @[@0.0f, @0.25f, @0.5f, @0.75f, @1.0f];
|
rotationXAnimation.keyTimes = @[@0.0f, @0.25f, @0.5f, @0.75f, @1.0f];
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
rotationXAnimation.timingFunctions = @[timingFunction, timingFunction, timingFunction, timingFunction];
|
rotationXAnimation.timingFunctions = @[timingFunction, timingFunction, timingFunction, timingFunction];
|
||||||
|
|
||||||
// Rotation x animation
|
// Rotation x animation
|
||||||
CAKeyframeAnimation *rotationYAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.y"];
|
CAKeyframeAnimation *rotationYAnimation = [self createKeyframeAnimationWithKeyPath:@"transform.rotation.y"];
|
||||||
|
|
||||||
rotationYAnimation.duration = duration;
|
rotationYAnimation.duration = duration;
|
||||||
rotationYAnimation.keyTimes = @[@0.0f, @0.25f, @0.5f, @0.75f, @1.0f];
|
rotationYAnimation.keyTimes = @[@0.0f, @0.25f, @0.5f, @0.75f, @1.0f];
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
rotationYAnimation.timingFunctions = @[timingFunction, timingFunction, timingFunction, timingFunction];
|
rotationYAnimation.timingFunctions = @[timingFunction, timingFunction, timingFunction, timingFunction];
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
CAAnimationGroup *animation = [CAAnimationGroup animation];
|
CAAnimationGroup *animation = [self createAnimationGroup];;
|
||||||
|
|
||||||
animation.animations = @[rotationXAnimation, rotationYAnimation];
|
animation.animations = @[rotationXAnimation, rotationYAnimation];
|
||||||
animation.duration = duration;
|
animation.duration = duration;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorTriplePulseAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorTriplePulseAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-4
@@ -27,16 +27,15 @@
|
|||||||
circle.cornerRadius = circle.bounds.size.height / 2.0f;
|
circle.cornerRadius = circle.bounds.size.height / 2.0f;
|
||||||
circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f);
|
circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];
|
CABasicAnimation *transformAnimation = [self createBasicAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0f, 0.0f, 0.0f)];
|
transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0f, 0.0f, 0.0f)];
|
||||||
transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)];
|
transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)];
|
||||||
|
|
||||||
CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
|
CABasicAnimation *opacityAnimation = [self createBasicAnimationWithKeyPath:@"opacity"];
|
||||||
opacityAnimation.fromValue = @(0.8f);
|
opacityAnimation.fromValue = @(0.8f);
|
||||||
opacityAnimation.toValue = @(0.0f);
|
opacityAnimation.toValue = @(0.0f);
|
||||||
|
|
||||||
CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
|
CAAnimationGroup *animationGroup = [self createAnimationGroup];;
|
||||||
animationGroup.removedOnCompletion = NO;
|
|
||||||
animationGroup.beginTime = beginTime + i * 0.2f;
|
animationGroup.beginTime = beginTime + i * 0.2f;
|
||||||
animationGroup.repeatCount = HUGE_VALF;
|
animationGroup.repeatCount = HUGE_VALF;
|
||||||
animationGroup.duration = 1.2f;
|
animationGroup.duration = 1.2f;
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
// Created by tripleCC on 15/6/28.
|
// Created by tripleCC on 15/6/28.
|
||||||
// Copyright (c) 2015年 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015年 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorTripleRingsAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorTripleRingsAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+3
-4
@@ -29,20 +29,19 @@
|
|||||||
circle.opacity = 1.0f;
|
circle.opacity = 1.0f;
|
||||||
circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f);
|
circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];
|
CABasicAnimation *transformAnimation = [self createBasicAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.duration = 2.0f - i * 0.4f;
|
transformAnimation.duration = 2.0f - i * 0.4f;
|
||||||
transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1f, 0.1f, 0.0f)];
|
transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1f, 0.1f, 0.0f)];
|
||||||
transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)];
|
transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0f, 1.0f, 0.0f)];
|
||||||
transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut];
|
transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut];
|
||||||
|
|
||||||
CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
|
CABasicAnimation *opacityAnimation = [self createBasicAnimationWithKeyPath:@"opacity"];
|
||||||
opacityAnimation.duration = transformAnimation.duration;
|
opacityAnimation.duration = transformAnimation.duration;
|
||||||
opacityAnimation.fromValue = @(1.0f);
|
opacityAnimation.fromValue = @(1.0f);
|
||||||
opacityAnimation.toValue = @(0.8f);
|
opacityAnimation.toValue = @(0.8f);
|
||||||
opacityAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut];
|
opacityAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut];
|
||||||
|
|
||||||
CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
|
CAAnimationGroup *animationGroup = [self createAnimationGroup];;
|
||||||
animationGroup.removedOnCompletion = NO;
|
|
||||||
animationGroup.beginTime = beginTime + i * 0.4f;
|
animationGroup.beginTime = beginTime + i * 0.4f;
|
||||||
animationGroup.repeatCount = HUGE_VALF;
|
animationGroup.repeatCount = HUGE_VALF;
|
||||||
animationGroup.duration = 2.0f;
|
animationGroup.duration = 2.0f;
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
// Copyright (c) 2015 Danil Gontovnik. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "DGActivityIndicatorAnimationProtocol.h"
|
#import "DGActivityIndicatorAnimation.h"
|
||||||
|
|
||||||
@interface DGActivityIndicatorTwoDotsAnimation : NSObject <DGActivityIndicatorAnimationProtocol>
|
@interface DGActivityIndicatorTwoDotsAnimation: DGActivityIndicatorAnimation
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+1
-2
@@ -25,8 +25,7 @@
|
|||||||
circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f);
|
circle.transform = CATransform3DMakeScale(0.0f, 0.0f, 0.0f);
|
||||||
circle.backgroundColor = tintColor.CGColor;
|
circle.backgroundColor = tintColor.CGColor;
|
||||||
|
|
||||||
CAKeyframeAnimation *transformAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
CAKeyframeAnimation *transformAnimation = [self createKeyframeAnimationWithKeyPath:@"transform"];
|
||||||
transformAnimation.removedOnCompletion = NO;
|
|
||||||
transformAnimation.repeatCount = HUGE_VALF;
|
transformAnimation.repeatCount = HUGE_VALF;
|
||||||
transformAnimation.duration = 1.8f;
|
transformAnimation.duration = 1.8f;
|
||||||
transformAnimation.beginTime = beginTime - (transformAnimation.duration / 2.0f * i);
|
transformAnimation.beginTime = beginTime - (transformAnimation.duration / 2.0f * i);
|
||||||
|
|||||||
+69
-8
@@ -44,11 +44,27 @@
|
|||||||
|
|
||||||
static const CGFloat kDGActivityIndicatorDefaultSize = 40.0f;
|
static const CGFloat kDGActivityIndicatorDefaultSize = 40.0f;
|
||||||
|
|
||||||
|
@interface DGActivityIndicatorView () {
|
||||||
|
CALayer *_animationLayer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation DGActivityIndicatorView
|
@implementation DGActivityIndicatorView
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Constructors
|
#pragma mark Constructors
|
||||||
|
|
||||||
|
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
|
||||||
|
self = [super initWithCoder:aDecoder];
|
||||||
|
if (self) {
|
||||||
|
_tintColor = [UIColor whiteColor];
|
||||||
|
_size = kDGActivityIndicatorDefaultSize;
|
||||||
|
[self commonInit];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
- (id)initWithType:(DGActivityIndicatorAnimationType)type {
|
- (id)initWithType:(DGActivityIndicatorAnimationType)type {
|
||||||
return [self initWithType:type tintColor:[UIColor whiteColor] size:kDGActivityIndicatorDefaultSize];
|
return [self initWithType:type tintColor:[UIColor whiteColor] size:kDGActivityIndicatorDefaultSize];
|
||||||
}
|
}
|
||||||
@@ -63,6 +79,7 @@ static const CGFloat kDGActivityIndicatorDefaultSize = 40.0f;
|
|||||||
_type = type;
|
_type = type;
|
||||||
_size = size;
|
_size = size;
|
||||||
_tintColor = tintColor;
|
_tintColor = tintColor;
|
||||||
|
[self commonInit];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -70,28 +87,41 @@ static const CGFloat kDGActivityIndicatorDefaultSize = 40.0f;
|
|||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Methods
|
#pragma mark Methods
|
||||||
|
|
||||||
|
- (void)commonInit {
|
||||||
|
self.userInteractionEnabled = NO;
|
||||||
|
self.hidden = YES;
|
||||||
|
|
||||||
|
_animationLayer = [[CALayer alloc] init];
|
||||||
|
[self.layer addSublayer:_animationLayer];
|
||||||
|
|
||||||
|
[self setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||||
|
[self setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setupAnimation {
|
- (void)setupAnimation {
|
||||||
self.layer.sublayers = nil;
|
_animationLayer.sublayers = nil;
|
||||||
|
|
||||||
id<DGActivityIndicatorAnimationProtocol> animation = [DGActivityIndicatorView activityIndicatorAnimationForAnimationType:_type];
|
id<DGActivityIndicatorAnimationProtocol> animation = [DGActivityIndicatorView activityIndicatorAnimationForAnimationType:_type];
|
||||||
|
|
||||||
if ([animation respondsToSelector:@selector(setupAnimationInLayer:withSize:tintColor:)]) {
|
if ([animation respondsToSelector:@selector(setupAnimationInLayer:withSize:tintColor:)]) {
|
||||||
[animation setupAnimationInLayer:self.layer withSize:CGSizeMake(_size, _size) tintColor:_tintColor];
|
[animation setupAnimationInLayer:_animationLayer withSize:CGSizeMake(_size, _size) tintColor:_tintColor];
|
||||||
self.layer.speed = 0.0f;
|
_animationLayer.speed = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)startAnimating {
|
- (void)startAnimating {
|
||||||
if (!self.layer.sublayers) {
|
if (!_animationLayer.sublayers) {
|
||||||
[self setupAnimation];
|
[self setupAnimation];
|
||||||
}
|
}
|
||||||
self.layer.speed = 1.0f;
|
self.hidden = NO;
|
||||||
|
_animationLayer.speed = 1.0f;
|
||||||
_animating = YES;
|
_animating = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)stopAnimating {
|
- (void)stopAnimating {
|
||||||
self.layer.speed = 0.0f;
|
_animationLayer.speed = 0.0f;
|
||||||
_animating = NO;
|
_animating = NO;
|
||||||
|
self.hidden = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
@@ -110,6 +140,7 @@ static const CGFloat kDGActivityIndicatorDefaultSize = 40.0f;
|
|||||||
_size = size;
|
_size = size;
|
||||||
|
|
||||||
[self setupAnimation];
|
[self setupAnimation];
|
||||||
|
[self invalidateIntrinsicContentSize];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,8 +148,15 @@ static const CGFloat kDGActivityIndicatorDefaultSize = 40.0f;
|
|||||||
if (![_tintColor isEqual:tintColor]) {
|
if (![_tintColor isEqual:tintColor]) {
|
||||||
_tintColor = tintColor;
|
_tintColor = tintColor;
|
||||||
|
|
||||||
for (CALayer *sublayer in self.layer.sublayers) {
|
CGColorRef tintColorRef = tintColor.CGColor;
|
||||||
sublayer.backgroundColor = tintColor.CGColor;
|
for (CALayer *sublayer in _animationLayer.sublayers) {
|
||||||
|
sublayer.backgroundColor = tintColorRef;
|
||||||
|
|
||||||
|
if ([sublayer isKindOfClass:[CAShapeLayer class]]) {
|
||||||
|
CAShapeLayer *shapeLayer = [[CAShapeLayer alloc] init];
|
||||||
|
shapeLayer.strokeColor = tintColorRef;
|
||||||
|
shapeLayer.fillColor = tintColorRef;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,4 +236,27 @@ static const CGFloat kDGActivityIndicatorDefaultSize = 40.0f;
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
#pragma mark Layout
|
||||||
|
|
||||||
|
- (void)layoutSubviews {
|
||||||
|
[super layoutSubviews];
|
||||||
|
|
||||||
|
_animationLayer.frame = self.bounds;
|
||||||
|
|
||||||
|
BOOL animating = _animating;
|
||||||
|
|
||||||
|
if (animating)
|
||||||
|
[self stopAnimating];
|
||||||
|
|
||||||
|
[self setupAnimation];
|
||||||
|
|
||||||
|
if (animating)
|
||||||
|
[self startAnimating];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGSize)intrinsicContentSize {
|
||||||
|
return CGSizeMake(_size, _size);
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
+2
-2
@@ -15,9 +15,9 @@ Open and run the DGActivityIndicatorExample project in Xcode to see DGActivityIn
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Cocoapods
|
### CocoaPods
|
||||||
|
|
||||||
Install Cocoapods if it is not installed yet:
|
Install CocoaPods if it is not installed yet:
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
$ [sudo] gem install cocoapods
|
$ [sudo] gem install cocoapods
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#import <CoreGraphics/CoreGraphics.h>
|
||||||
#import <Expecta/Expecta.h>
|
#import <Expecta/Expecta.h>
|
||||||
#import "ExpectaObject+FBSnapshotTest.h"
|
#import "ExpectaObject+FBSnapshotTest.h"
|
||||||
|
|
||||||
@@ -12,3 +13,6 @@ EXPMatcherInterface(recordSnapshot, (void));
|
|||||||
|
|
||||||
EXPMatcherInterface(haveValidSnapshotNamed, (NSString *snapshot));
|
EXPMatcherInterface(haveValidSnapshotNamed, (NSString *snapshot));
|
||||||
EXPMatcherInterface(recordSnapshotNamed, (NSString *snapshot));
|
EXPMatcherInterface(recordSnapshotNamed, (NSString *snapshot));
|
||||||
|
|
||||||
|
EXPMatcherInterface(haveValidSnapshotNamedWithTolerance, (NSString *snapshot, CGFloat tolerance));
|
||||||
|
EXPMatcherInterface(haveValidSnapshotWithTolerance, (CGFloat tolerance));
|
||||||
+44
-17
@@ -18,13 +18,14 @@
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer snapshot:(NSString *)snapshot testCase:(id)testCase record:(BOOL)record referenceDirectory:(NSString *)referenceDirectory error:(NSError **)error
|
+ (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer snapshot:(NSString *)snapshot testCase:(id)testCase record:(BOOL)record referenceDirectory:(NSString *)referenceDirectory tolerance:(CGFloat)tolerance error:(NSError **)error
|
||||||
|
|
||||||
{
|
{
|
||||||
FBSnapshotTestController *snapshotController = [[FBSnapshotTestController alloc] initWithTestClass:[testCase class]];
|
FBSnapshotTestController *snapshotController = [[FBSnapshotTestController alloc] initWithTestClass:[testCase class]];
|
||||||
snapshotController.recordMode = record;
|
snapshotController.recordMode = record;
|
||||||
snapshotController.referenceImagesDirectory = referenceDirectory;
|
snapshotController.referenceImagesDirectory = referenceDirectory;
|
||||||
snapshotController.usesDrawViewHierarchyInRect = [Expecta usesDrawViewHierarchyInRect];
|
snapshotController.usesDrawViewHierarchyInRect = [Expecta usesDrawViewHierarchyInRect];
|
||||||
|
snapshotController.deviceAgnostic = [Expecta isDeviceAgnostic];
|
||||||
|
|
||||||
if (! snapshotController.referenceImagesDirectory) {
|
if (! snapshotController.referenceImagesDirectory) {
|
||||||
[NSException raise:@"Missing value for referenceImagesDirectory" format:@"Call [[EXPExpectFBSnapshotTest instance] setReferenceImagesDirectory"];
|
[NSException raise:@"Missing value for referenceImagesDirectory" format:@"Call [[EXPExpectFBSnapshotTest instance] setReferenceImagesDirectory"];
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
return [snapshotController compareSnapshotOfViewOrLayer:viewOrLayer
|
return [snapshotController compareSnapshotOfViewOrLayer:viewOrLayer
|
||||||
selector:NSSelectorFromString(snapshot)
|
selector:NSSelectorFromString(snapshot)
|
||||||
identifier:nil
|
identifier:nil
|
||||||
tolerance:0
|
tolerance:tolerance
|
||||||
error:error];
|
error:error];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,18 +80,36 @@ void setGlobalReferenceImageDir(char *reference) {
|
|||||||
NSString *testFileName = [NSString stringWithCString:self.fileName encoding:NSUTF8StringEncoding];
|
NSString *testFileName = [NSString stringWithCString:self.fileName encoding:NSUTF8StringEncoding];
|
||||||
NSArray *pathComponents = [testFileName pathComponents];
|
NSArray *pathComponents = [testFileName pathComponents];
|
||||||
|
|
||||||
for (NSString *folder in pathComponents) {
|
NSString *firstFolderFound = nil;
|
||||||
|
|
||||||
|
for (NSString *folder in pathComponents.reverseObjectEnumerator) {
|
||||||
if ([folder.lowercaseString rangeOfString:@"tests"].location != NSNotFound) {
|
if ([folder.lowercaseString rangeOfString:@"tests"].location != NSNotFound) {
|
||||||
|
|
||||||
NSArray *folderPathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents indexOfObject:folder] + 1)];
|
NSArray *folderPathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents indexOfObject:folder] + 1)];
|
||||||
return [NSString stringWithFormat:@"%@/ReferenceImages", [folderPathComponents componentsJoinedByString:@"/"]];
|
NSString *referenceImagesPath = [NSString stringWithFormat:@"%@/ReferenceImages", [folderPathComponents componentsJoinedByString:@"/"]];
|
||||||
|
|
||||||
|
if (!firstFolderFound) {
|
||||||
|
firstFolderFound = referenceImagesPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL isDirectory = NO;
|
||||||
|
BOOL referenceDirExists = [[NSFileManager defaultManager] fileExistsAtPath:referenceImagesPath isDirectory:&isDirectory];
|
||||||
|
|
||||||
|
// if the folder exists, this is the reference dir for sure
|
||||||
|
if (referenceDirExists && isDirectory) {
|
||||||
|
return referenceImagesPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if a reference folder wasn't found, we should create one
|
||||||
|
if (firstFolderFound) {
|
||||||
|
return firstFolderFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
[NSException raise:@"Could not infer reference image folder" format:@"You should provide a reference dir using setGlobalReferenceImageDir(FB_REFERENCE_IMAGE_DIR);"];
|
[NSException raise:@"Could not infer reference image folder" format:@"You should provide a reference dir using setGlobalReferenceImageDir(FB_REFERENCE_IMAGE_DIR);"];
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
@@ -114,11 +133,11 @@ NSString *sanitizedTestPath(){
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPMatcherImplementationBegin(haveValidSnapshot, (void)){
|
EXPMatcherImplementationBegin(haveValidSnapshotWithTolerance, (CGFloat tolerance)){
|
||||||
__block NSError *error = nil;
|
__block NSError *error = nil;
|
||||||
|
|
||||||
prerequisite(^BOOL{
|
prerequisite(^BOOL{
|
||||||
return actual;
|
return actual != nil;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -132,7 +151,7 @@ EXPMatcherImplementationBegin(haveValidSnapshot, (void)){
|
|||||||
actual = [actual view];
|
actual = [actual view];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:name testCase:[self testCase] record:NO referenceDirectory:referenceImageDir error:&error];
|
return [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:name testCase:[self testCase] record:NO referenceDirectory:referenceImageDir tolerance:tolerance error:&error];
|
||||||
});
|
});
|
||||||
|
|
||||||
failureMessageForTo(^NSString *{
|
failureMessageForTo(^NSString *{
|
||||||
@@ -149,18 +168,22 @@ EXPMatcherImplementationBegin(haveValidSnapshot, (void)){
|
|||||||
}
|
}
|
||||||
EXPMatcherImplementationEnd
|
EXPMatcherImplementationEnd
|
||||||
|
|
||||||
|
EXPMatcherImplementationBegin(haveValidSnapshot, (void)) {
|
||||||
|
return self.haveValidSnapshotWithTolerance(0);
|
||||||
|
}
|
||||||
|
EXPMatcherImplementationEnd
|
||||||
|
|
||||||
EXPMatcherImplementationBegin(recordSnapshot, (void)) {
|
EXPMatcherImplementationBegin(recordSnapshot, (void)) {
|
||||||
__block NSError *error = nil;
|
__block NSError *error = nil;
|
||||||
|
|
||||||
BOOL actualIsViewLayerOrViewController = ([actual isKindOfClass:UIView.class] || [actual isKindOfClass:CALayer.class] || [actual isKindOfClass:UIViewController.class]);
|
BOOL actualIsViewLayerOrViewController = ([actual isKindOfClass:UIView.class] || [actual isKindOfClass:CALayer.class] || [actual isKindOfClass:UIViewController.class]);
|
||||||
|
|
||||||
prerequisite(^BOOL{
|
prerequisite(^BOOL{
|
||||||
return actual && actualIsViewLayerOrViewController;
|
return actual != nil && actualIsViewLayerOrViewController;
|
||||||
});
|
});
|
||||||
|
|
||||||
match(^BOOL{
|
match(^BOOL{
|
||||||
NSString *referenceImageDir = [self _getDefaultReferenceDirectory];
|
NSString *referenceImageDir = [self _getDefaultReferenceDirectory];
|
||||||
|
|
||||||
// For view controllers do the viewWill/viewDid dance, then pass view through
|
// For view controllers do the viewWill/viewDid dance, then pass view through
|
||||||
if ([actual isKindOfClass:UIViewController.class]) {
|
if ([actual isKindOfClass:UIViewController.class]) {
|
||||||
|
|
||||||
@@ -169,7 +192,7 @@ EXPMatcherImplementationBegin(recordSnapshot, (void)) {
|
|||||||
actual = [actual view];
|
actual = [actual view];
|
||||||
}
|
}
|
||||||
|
|
||||||
[EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:sanitizedTestPath() testCase:[self testCase] record:YES referenceDirectory:referenceImageDir error:&error];
|
[EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:sanitizedTestPath() testCase:[self testCase] record:YES referenceDirectory:referenceImageDir tolerance:0 error:&error];
|
||||||
return NO;
|
return NO;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -198,12 +221,12 @@ EXPMatcherImplementationBegin(recordSnapshot, (void)) {
|
|||||||
}
|
}
|
||||||
EXPMatcherImplementationEnd
|
EXPMatcherImplementationEnd
|
||||||
|
|
||||||
EXPMatcherImplementationBegin(haveValidSnapshotNamed, (NSString *snapshot)){
|
EXPMatcherImplementationBegin(haveValidSnapshotNamedWithTolerance, (NSString *snapshot, CGFloat tolerance)) {
|
||||||
BOOL snapshotIsNil = (snapshot == nil);
|
BOOL snapshotIsNil = (snapshot == nil);
|
||||||
__block NSError *error = nil;
|
__block NSError *error = nil;
|
||||||
|
|
||||||
prerequisite(^BOOL{
|
prerequisite(^BOOL{
|
||||||
return actual && !(snapshotIsNil);
|
return actual != nil && !(snapshotIsNil);
|
||||||
});
|
});
|
||||||
|
|
||||||
match(^BOOL{
|
match(^BOOL{
|
||||||
@@ -214,7 +237,7 @@ EXPMatcherImplementationBegin(haveValidSnapshotNamed, (NSString *snapshot)){
|
|||||||
|
|
||||||
actual = [actual view];
|
actual = [actual view];
|
||||||
}
|
}
|
||||||
return [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:snapshot testCase:[self testCase] record:NO referenceDirectory:referenceImageDir error:&error];
|
return [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:snapshot testCase:[self testCase] record:NO referenceDirectory:referenceImageDir tolerance:tolerance error:&error];
|
||||||
});
|
});
|
||||||
|
|
||||||
failureMessageForTo(^NSString *{
|
failureMessageForTo(^NSString *{
|
||||||
@@ -232,6 +255,11 @@ EXPMatcherImplementationBegin(haveValidSnapshotNamed, (NSString *snapshot)){
|
|||||||
}
|
}
|
||||||
EXPMatcherImplementationEnd
|
EXPMatcherImplementationEnd
|
||||||
|
|
||||||
|
EXPMatcherImplementationBegin(haveValidSnapshotNamed, (NSString *snapshot)) {
|
||||||
|
return self.haveValidSnapshotNamedWithTolerance(snapshot, 0);
|
||||||
|
}
|
||||||
|
EXPMatcherImplementationEnd
|
||||||
|
|
||||||
EXPMatcherImplementationBegin(recordSnapshotNamed, (NSString *snapshot)) {
|
EXPMatcherImplementationBegin(recordSnapshotNamed, (NSString *snapshot)) {
|
||||||
BOOL snapshotExists = (snapshot != nil);
|
BOOL snapshotExists = (snapshot != nil);
|
||||||
BOOL actualIsViewLayerOrViewController = ([actual isKindOfClass:UIView.class] || [actual isKindOfClass:CALayer.class] || [actual isKindOfClass:UIViewController.class]);
|
BOOL actualIsViewLayerOrViewController = ([actual isKindOfClass:UIView.class] || [actual isKindOfClass:CALayer.class] || [actual isKindOfClass:UIViewController.class]);
|
||||||
@@ -239,12 +267,11 @@ EXPMatcherImplementationBegin(recordSnapshotNamed, (NSString *snapshot)) {
|
|||||||
id actualRef = actual;
|
id actualRef = actual;
|
||||||
|
|
||||||
prerequisite(^BOOL{
|
prerequisite(^BOOL{
|
||||||
return actualRef && snapshotExists && actualIsViewLayerOrViewController;
|
return actualRef != nil && snapshotExists && actualIsViewLayerOrViewController;
|
||||||
});
|
});
|
||||||
|
|
||||||
match(^BOOL{
|
match(^BOOL{
|
||||||
NSString *referenceImageDir = [self _getDefaultReferenceDirectory];
|
NSString *referenceImageDir = [self _getDefaultReferenceDirectory];
|
||||||
|
|
||||||
// For view controllers do the viewWill/viewDid dance, then pass view through
|
// For view controllers do the viewWill/viewDid dance, then pass view through
|
||||||
if ([actual isKindOfClass:UIViewController.class]) {
|
if ([actual isKindOfClass:UIViewController.class]) {
|
||||||
[actual beginAppearanceTransition:YES animated:NO];
|
[actual beginAppearanceTransition:YES animated:NO];
|
||||||
@@ -252,7 +279,7 @@ EXPMatcherImplementationBegin(recordSnapshotNamed, (NSString *snapshot)) {
|
|||||||
actual = [actual view];
|
actual = [actual view];
|
||||||
}
|
}
|
||||||
|
|
||||||
[EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:snapshot testCase:[self testCase] record:YES referenceDirectory:referenceImageDir error:&error];
|
[EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:snapshot testCase:[self testCase] record:YES referenceDirectory:referenceImageDir tolerance:0 error:&error];
|
||||||
return NO;
|
return NO;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -14,4 +14,8 @@
|
|||||||
|
|
||||||
+ (BOOL)usesDrawViewHierarchyInRect;
|
+ (BOOL)usesDrawViewHierarchyInRect;
|
||||||
|
|
||||||
|
+ (void)setDeviceAgnostic:(BOOL)deviceAgnostic;
|
||||||
|
|
||||||
|
+ (BOOL)isDeviceAgnostic;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -22,4 +22,15 @@ static NSString const *kUsesDrawViewHierarchyInRectKey = @"ExpectaObject+FBSnaps
|
|||||||
return usesDrawViewHierarchyInRect.boolValue;
|
return usesDrawViewHierarchyInRect.boolValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (void)setDeviceAgnostic:(BOOL)deviceAgnostic
|
||||||
|
{
|
||||||
|
objc_setAssociatedObject(self, @selector(isDeviceAgnostic), @(deviceAgnostic), OBJC_ASSOCIATION_ASSIGN);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (BOOL)isDeviceAgnostic
|
||||||
|
{
|
||||||
|
NSNumber *isDeviceAgnostic = objc_getAssociatedObject(self, @selector(isDeviceAgnostic));
|
||||||
|
return isDeviceAgnostic.boolValue;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Generated
+10
-1
@@ -3,7 +3,7 @@ Expecta Matchers for FBSnapshotTestCase
|
|||||||
|
|
||||||
[Expecta](https://github.com/specta/expecta) matchers for [ios-snapshot-test-case](https://github.com/facebook/ios-snapshot-test-case).
|
[Expecta](https://github.com/specta/expecta) matchers for [ios-snapshot-test-case](https://github.com/facebook/ios-snapshot-test-case).
|
||||||
|
|
||||||
[](https://travis-ci.org/dblock/ios-snapshot-test-case-expecta)
|
[](https://travis-ci.org/dblock/ios-snapshot-test-case-expecta)
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
@@ -63,6 +63,15 @@ describe(@"test name derived matching", ^{
|
|||||||
SpecEnd
|
SpecEnd
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Approximation support
|
||||||
|
|
||||||
|
If for some reason you want to specify a tolerance for your test, you can use either named or unnamed matchers, where the `tolerance` parameter is a `CGFloat` in the interval `[0, 1]` and it represents the minimum ratio of unmatched points by the total number of points in your snapshot. In the example below, a tolerance of `0.01` means our `view` could be up to `1%` different from the reference image.
|
||||||
|
|
||||||
|
``` Objective-C
|
||||||
|
expect(view).to.haveValidSnapshotWithTolerance(0.01);
|
||||||
|
expect(view).to.haveValidSnapshotNamedWithTolerance(@"unique snapshot name", 0.01);
|
||||||
|
```
|
||||||
|
|
||||||
### Sane defaults
|
### Sane defaults
|
||||||
|
|
||||||
`EXPMatchers+FBSnapshotTest` will automatically figure out the tests folder, and [add a reference image](https://github.com/dblock/ios-snapshot-test-case-expecta/blob/master/EXPMatchers%2BFBSnapshotTest.m#L84-L85) directory, if you'd like to override this, you should include a `beforeAll` block setting the `setGlobalReferenceImageDir` in each file containing tests.
|
`EXPMatchers+FBSnapshotTest` will automatically figure out the tests folder, and [add a reference image](https://github.com/dblock/ios-snapshot-test-case-expecta/blob/master/EXPMatchers%2BFBSnapshotTest.m#L84-L85) directory, if you'd like to override this, you should include a `beforeAll` block setting the `setGlobalReferenceImageDir` in each file containing tests.
|
||||||
|
|||||||
+4
-4
@@ -9,9 +9,9 @@
|
|||||||
#ifndef Expecta_EXPDefines_h
|
#ifndef Expecta_EXPDefines_h
|
||||||
#define Expecta_EXPDefines_h
|
#define Expecta_EXPDefines_h
|
||||||
|
|
||||||
typedef void (^EXPBasicBlock)();
|
typedef void (^EXPBasicBlock)(void);
|
||||||
typedef id (^EXPIdBlock)();
|
typedef id (^EXPIdBlock)(void);
|
||||||
typedef BOOL (^EXPBoolBlock)();
|
typedef BOOL (^EXPBoolBlock)(void);
|
||||||
typedef NSString *(^EXPStringBlock)();
|
typedef NSString *(^EXPStringBlock)(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -10,6 +10,10 @@ EXPMatcherImplementationBegin(respondTo, (SEL expected)) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
match(^BOOL {
|
match(^BOOL {
|
||||||
|
if ([actual respondsToSelector:@selector(instancesRespondToSelector:)] &&
|
||||||
|
[actual instancesRespondToSelector:expected]) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
return [actual respondsToSelector:expected];
|
return [actual respondsToSelector:expected];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Generated
+72
-68
@@ -1,13 +1,8 @@
|
|||||||
#Expecta
|
# Expecta [](https://travis-ci.org/specta/expecta) [](http://cocoadocs.org/docsets/Expecta/)
|
||||||
|
|
||||||
[](https://travis-ci.org/specta/expecta)
|
|
||||||
[](http://cocoadocs.org/docsets/Expecta/)
|
|
||||||
[](http://cocoadocs.org/docsets/Expecta/)
|
|
||||||
[](https://www.apache.org/licenses/LICENSE-2.0.html)
|
|
||||||
|
|
||||||
A matcher framework for Objective-C and Cocoa.
|
A matcher framework for Objective-C and Cocoa.
|
||||||
|
|
||||||
## Introduction
|
## FEATURES
|
||||||
|
|
||||||
The main advantage of using Expecta over other matcher frameworks is that you do not have to specify the data types. Also, the syntax of Expecta matchers is much more readable and does not suffer from parenthesitis.
|
The main advantage of using Expecta over other matcher frameworks is that you do not have to specify the data types. Also, the syntax of Expecta matchers is much more readable and does not suffer from parenthesitis.
|
||||||
|
|
||||||
@@ -18,63 +13,10 @@ expect([bar isBar]).to.equal(YES);
|
|||||||
expect(baz).to.equal(3.14159);
|
expect(baz).to.equal(3.14159);
|
||||||
```
|
```
|
||||||
|
|
||||||
Expecta is framework-agnostic: it works well with XCTest and XCTest-compatible test frameworks such as [Specta](http://github.com/petejkim/specta/).
|
Expecta is framework-agnostic: it works well with XCTest and XCTest-compatible test frameworks such as [Specta](http://github.com/petejkim/specta/), or [Kiwi](https://github.com/kiwi-bdd/Kiwi/).
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## MATCHERS
|
||||||
|
|
||||||
You can setup Expecta using [Carthage](https://github.com/Carthage/Carthage), [CocoaPods](http://github.com/CocoaPods/CocoaPods) or [completely manually](#setting-up-manually).
|
|
||||||
|
|
||||||
### Carthage
|
|
||||||
|
|
||||||
1. Add Expecta to your project's `Cartfile.private`:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
github "specta/expecta" "master"
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Run `carthage update` in your project directory.
|
|
||||||
3. Drag the appropriate **Expecta.framework** for your platform (located in `Carthage/Build/`) into your application’s Xcode project, and add it to your test target(s).
|
|
||||||
|
|
||||||
### CocoaPods
|
|
||||||
|
|
||||||
1. Add Expecta to your project's `Podfile`:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
target :MyApp do
|
|
||||||
# Your app's dependencies
|
|
||||||
end
|
|
||||||
|
|
||||||
target :MyAppTests do
|
|
||||||
pod 'Expecta', '~> 1.0.0'
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Run `pod update` or `pod install` in your project directory.
|
|
||||||
|
|
||||||
### Setting Up Manually
|
|
||||||
|
|
||||||
1. Clone Expecta from Github.
|
|
||||||
2. Run `rake` in your project directory to build the frameworks and libraries.
|
|
||||||
3. Add a Cocoa or Cocoa Touch Unit Testing Bundle target to your Xcode project if you don't already have one.
|
|
||||||
4. For **OS X projects**, copy and add `Expecta.framework` in the `Products/osx` folder to your project's test target.
|
|
||||||
|
|
||||||
For **iOS projects**, copy and add `Expecta.framework` in the `Products/ios` folder to your project's test target.
|
|
||||||
|
|
||||||
You can also use `libExpecta.a` if you prefer to link Expecta as a static library — iOS 7.x and below require this.
|
|
||||||
|
|
||||||
6. Add `-ObjC` and `-all_load` to the **Other Linker Flags** build setting for the test target in your Xcode project.
|
|
||||||
7. You can now use Expecta in your test classes by adding the following import:
|
|
||||||
|
|
||||||
```objective-c
|
|
||||||
@import Expecta; // If you're using Expecta.framework
|
|
||||||
|
|
||||||
// OR
|
|
||||||
|
|
||||||
#import <Expecta/Expecta.h> // If you're using the static library, or the framework
|
|
||||||
```
|
|
||||||
|
|
||||||
## Built-in Matchers
|
|
||||||
|
|
||||||
> `expect(x).to.equal(y);` compares objects or primitives x and y and passes if they are identical (==) or equivalent isEqual:).
|
> `expect(x).to.equal(y);` compares objects or primitives x and y and passes if they are identical (==) or equivalent isEqual:).
|
||||||
|
|
||||||
@@ -132,13 +74,13 @@ You can setup Expecta using [Carthage](https://github.com/Carthage/Carthage), [C
|
|||||||
|
|
||||||
> `expect(x).to.match(y);` passes if an instance of NSString `x` matches regular expression (given as NSString) `y` one or more times.
|
> `expect(x).to.match(y);` passes if an instance of NSString `x` matches regular expression (given as NSString) `y` one or more times.
|
||||||
|
|
||||||
## Inverting Matchers
|
### Inverting Matchers
|
||||||
|
|
||||||
Every matcher's criteria can be inverted by prepending `.notTo` or `.toNot`:
|
Every matcher's criteria can be inverted by prepending `.notTo` or `.toNot`:
|
||||||
|
|
||||||
>`expect(x).notTo.equal(y);` compares objects or primitives x and y and passes if they are *not* equivalent.
|
>`expect(x).notTo.equal(y);` compares objects or primitives x and y and passes if they are *not* equivalent.
|
||||||
|
|
||||||
## Asynchronous Testing
|
### Asynchronous Testing
|
||||||
|
|
||||||
Every matcher can be made to perform asynchronous testing by prepending `.will`, `.willNot` or `after(...)`:
|
Every matcher can be made to perform asynchronous testing by prepending `.will`, `.willNot` or `after(...)`:
|
||||||
|
|
||||||
@@ -172,14 +114,14 @@ describe(@"Foo", ^{
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## Forced Failing
|
### Forced Failing
|
||||||
|
|
||||||
You can fail a test by using the `failure` attribute. This can be used to test branching.
|
You can fail a test by using the `failure` attribute. This can be used to test branching.
|
||||||
|
|
||||||
> `failure(@"This should not happen");` outright fails a test.
|
> `failure(@"This should not happen");` outright fails a test.
|
||||||
|
|
||||||
|
|
||||||
## Writing New Matchers
|
### WRITING NEW MATCHERS
|
||||||
|
|
||||||
Writing a new matcher is easy with special macros provided by Expecta. Take a look at how `.beKindOf()` matcher is defined:
|
Writing a new matcher is easy with special macros provided by Expecta. Take a look at how `.beKindOf()` matcher is defined:
|
||||||
|
|
||||||
@@ -246,7 +188,7 @@ EXPMatcherImplementationBegin(beKindOf, (Class expected)) {
|
|||||||
EXPMatcherImplementationEnd
|
EXPMatcherImplementationEnd
|
||||||
```
|
```
|
||||||
|
|
||||||
## Dynamic Predicate Matchers
|
## DYNAMIC PREDICATE MATCHERS
|
||||||
|
|
||||||
It is possible to add predicate matchers by simply defining the matcher interface, with the matcher implementation being handled at runtime by delegating to the predicate method on your object.
|
It is possible to add predicate matchers by simply defining the matcher interface, with the matcher implementation being handled at runtime by delegating to the predicate method on your object.
|
||||||
|
|
||||||
@@ -282,6 +224,68 @@ You can now write your assertion as follows:
|
|||||||
expect(lightSwitch).isTurnedOn();
|
expect(lightSwitch).isTurnedOn();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## INSTALLATION
|
||||||
|
|
||||||
|
You can setup Expecta using [CocoaPods](http://github.com/CocoaPods/CocoaPods), [Carthage](https://github.com/Carthage/Carthage) or [completely manually](#setting-up-manually).
|
||||||
|
|
||||||
|
### CocoaPods
|
||||||
|
|
||||||
|
1. Add Expecta to your project's `Podfile`:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
target :MyApp do
|
||||||
|
# your app dependencies
|
||||||
|
|
||||||
|
target :MyAppTests do
|
||||||
|
inherit! search_paths
|
||||||
|
|
||||||
|
pod 'Expecta', '~> 1.0'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Carthage
|
||||||
|
|
||||||
|
1. Add Expecta to your project's `Cartfile.private`:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
github "specta/expecta" "master"
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Run `carthage update` in your project directory.
|
||||||
|
3. Drag the appropriate **Expecta.framework** for your platform (located in `Carthage/Build/`) into your application’s Xcode project, and add it to your test target(s).
|
||||||
|
|
||||||
|
|
||||||
|
2. Run `pod update` or `pod install` in your project directory.
|
||||||
|
|
||||||
|
### Setting Up Manually
|
||||||
|
|
||||||
|
1. Clone Expecta from Github.
|
||||||
|
2. Run `rake` in your project directory to build the frameworks and libraries.
|
||||||
|
3. Add a Cocoa or Cocoa Touch Unit Testing Bundle target to your Xcode project if you don't already have one.
|
||||||
|
4. For **OS X projects**, copy and add `Expecta.framework` in the `Products/osx` folder to your project's test target.
|
||||||
|
|
||||||
|
For **iOS projects**, copy and add `Expecta.framework` in the `Products/ios` folder to your project's test target.
|
||||||
|
|
||||||
|
You can also use `libExpecta.a` if you prefer to link Expecta as a static library — iOS 7.x and below require this.
|
||||||
|
|
||||||
|
6. Add `-ObjC` and `-all_load` to the **Other Linker Flags** build setting for the test target in your Xcode project.
|
||||||
|
7. You can now use Expecta in your test classes by adding the following import:
|
||||||
|
|
||||||
|
```objective-c
|
||||||
|
@import Expecta; // If you're using Expecta.framework
|
||||||
|
|
||||||
|
// OR
|
||||||
|
|
||||||
|
#import <Expecta/Expecta.h> // If you're using the static library, or the framework
|
||||||
|
```
|
||||||
|
|
||||||
|
## STATUS
|
||||||
|
|
||||||
|
Expecta, and Specta are considered done projects, there are no plans for _active_ development on the project at the moment aside from ensuring future Xcode compatability.
|
||||||
|
Therefore it is a stable dependency, but will not be moving into the Swift world. If you are looking for that, we recommend you consider [Quick](https://github.com/quick/quick) and [Nimble](https://github.com/quick/nimble).
|
||||||
|
|
||||||
|
|
||||||
## Contribution Guidelines
|
## Contribution Guidelines
|
||||||
|
|
||||||
* Please use only spaces and indent 2 spaces at a time.
|
* Please use only spaces and indent 2 spaces at a time.
|
||||||
@@ -290,4 +294,4 @@ expect(lightSwitch).isTurnedOn();
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Copyright (c) 2012-2015 [Specta Team](https://github.com/specta?tab=members). This software is licensed under the [MIT License](http://github.com/specta/specta/raw/master/LICENSE).
|
Copyright (c) 2012-2016 [Specta Team](https://github.com/specta?tab=members). This software is licensed under the [MIT License](http://github.com/specta/specta/raw/master/LICENSE).
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
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"
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -62,43 +62,9 @@
|
|||||||
|
|
||||||
#define FBSnapshotVerifyViewOrLayerWithOptions(what__, viewOrLayer__, identifier__, suffixes__, tolerance__) \
|
#define FBSnapshotVerifyViewOrLayerWithOptions(what__, viewOrLayer__, identifier__, suffixes__, tolerance__) \
|
||||||
{ \
|
{ \
|
||||||
NSString *referenceImageDirectory = [self getReferenceImageDirectoryWithDefault:(@ FB_REFERENCE_IMAGE_DIR)]; \
|
NSString *errorDescription = [self snapshotVerifyViewOrLayer:viewOrLayer__ identifier:identifier__ suffixes:suffixes__ tolerance:tolerance__]; \
|
||||||
XCTAssertNotNil(referenceImageDirectory, @"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.");\
|
BOOL noErrors = (errorDescription == nil); \
|
||||||
XCTAssertTrue((suffixes__.count > 0), @"Suffixes set cannot be empty %@", suffixes__); \
|
XCTAssertTrue(noErrors, @"%@", errorDescription); \
|
||||||
\
|
|
||||||
BOOL testSuccess__ = NO; \
|
|
||||||
NSError *error__ = nil; \
|
|
||||||
NSMutableArray *errors__ = [NSMutableArray array]; \
|
|
||||||
\
|
|
||||||
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__]; \
|
|
||||||
} \
|
|
||||||
} 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!"); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -148,6 +114,19 @@
|
|||||||
- (void)setUp NS_REQUIRES_SUPER;
|
- (void)setUp NS_REQUIRES_SUPER;
|
||||||
- (void)tearDown NS_REQUIRES_SUPER;
|
- (void)tearDown NS_REQUIRES_SUPER;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Performs the comparison or records a snapshot of the layer if recordMode is YES.
|
||||||
|
@param viewOrLayer The UIView or CALayer to snapshot
|
||||||
|
@param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method.
|
||||||
|
@param suffixes An NSOrderedSet of strings for the different suffixes
|
||||||
|
@param tolerance The percentage difference to still count as identical - 0 mean pixel perfect, 1 means I don't care
|
||||||
|
@returns nil if the comparison (or saving of the reference image) succeeded. Otherwise it contains an error description.
|
||||||
|
*/
|
||||||
|
- (NSString *)snapshotVerifyViewOrLayer:(id)viewOrLayer
|
||||||
|
identifier:(NSString *)identifier
|
||||||
|
suffixes:(NSOrderedSet *)suffixes
|
||||||
|
tolerance:(CGFloat)tolerance;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
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
|
||||||
|
|||||||
@@ -65,6 +65,62 @@
|
|||||||
|
|
||||||
#pragma mark - Public API
|
#pragma mark - Public API
|
||||||
|
|
||||||
|
- (NSString *)snapshotVerifyViewOrLayer:(id)viewOrLayer
|
||||||
|
identifier:(NSString *)identifier
|
||||||
|
suffixes:(NSOrderedSet *)suffixes
|
||||||
|
tolerance:(CGFloat)tolerance
|
||||||
|
{
|
||||||
|
if (nil == viewOrLayer) {
|
||||||
|
return @"Object to be snapshotted must not be nil";
|
||||||
|
}
|
||||||
|
NSString *referenceImageDirectory = [self getReferenceImageDirectoryWithDefault:(@ FB_REFERENCE_IMAGE_DIR)];
|
||||||
|
if (referenceImageDirectory == nil) {
|
||||||
|
return @"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.";
|
||||||
|
}
|
||||||
|
if (suffixes.count == 0) {
|
||||||
|
return [NSString stringWithFormat:@"Suffixes set cannot be empty %@", suffixes];
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL testSuccess = NO;
|
||||||
|
NSError *error = nil;
|
||||||
|
NSMutableArray *errors = [NSMutableArray array];
|
||||||
|
|
||||||
|
if (self.recordMode) {
|
||||||
|
NSString *referenceImagesDirectory = [NSString stringWithFormat:@"%@%@", referenceImageDirectory, suffixes.firstObject];
|
||||||
|
BOOL referenceImageSaved = [self _compareSnapshotOfViewOrLayer:viewOrLayer referenceImagesDirectory:referenceImagesDirectory identifier:(identifier) tolerance:tolerance error:&error];
|
||||||
|
if (!referenceImageSaved) {
|
||||||
|
[errors addObject: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 _compareSnapshotOfViewOrLayer:viewOrLayer referenceImagesDirectory:referenceImagesDirectory identifier:identifier tolerance:tolerance error:&error];
|
||||||
|
[errors removeAllObjects];
|
||||||
|
if (comparisonSuccess) {
|
||||||
|
testSuccess = YES;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
[errors addObject:error];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
[errors addObject:error];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!testSuccess) {
|
||||||
|
return [NSString stringWithFormat:@"Snapshot comparison failed: %@", errors.firstObject];
|
||||||
|
}
|
||||||
|
if (self.recordMode) {
|
||||||
|
return @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!";
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer
|
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer
|
||||||
referenceImagesDirectory:(NSString *)referenceImagesDirectory
|
referenceImagesDirectory:(NSString *)referenceImagesDirectory
|
||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
public extension FBSnapshotTestCase {
|
|
||||||
public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) {
|
|
||||||
FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) {
|
|
||||||
FBSnapshotVerifyViewOrLayer(layer, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line)
|
|
||||||
}
|
|
||||||
|
|
||||||
private func FBSnapshotVerifyViewOrLayer(viewOrLayer: AnyObject, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) {
|
|
||||||
let envReferenceImageDirectory = self.getReferenceImageDirectoryWithDefault(FB_REFERENCE_IMAGE_DIR)
|
|
||||||
var error: NSError?
|
|
||||||
var comparisonSuccess = false
|
|
||||||
|
|
||||||
if let envReferenceImageDirectory = envReferenceImageDirectory {
|
|
||||||
for suffix in suffixes {
|
|
||||||
let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)"
|
|
||||||
if viewOrLayer.isKindOfClass(UIView) {
|
|
||||||
do {
|
|
||||||
try compareSnapshotOfView(viewOrLayer as! UIView, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: tolerance)
|
|
||||||
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: tolerance)
|
|
||||||
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 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
XCTFail("Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func assert(assertion: Bool, message: String, file: StaticString, line: UInt) {
|
|
||||||
if !assertion {
|
|
||||||
XCTFail(message, file: file, line: line)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/DGActivityIndicatorAnimationProtocol.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallBeatAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallClipRotateAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallClipRotateMultipleAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallClipRotatePulseAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallGridBeatAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallGridPulseAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallPulseAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallPulseSyncAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallRotateAnimation.h
|
||||||
Generated
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../DGActivityIndicatorView/DGActivityIndicatorView/Animations/DGActivityIndicatorBallScaleAnimation.h
|
||||||
Loaded 100 of 277 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user