Compare commits
46 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edc099d6be | ||
|
|
81c8672414 | ||
|
|
df34c1b896 | ||
|
|
79fd869347 | ||
|
|
38c24c156a | ||
|
|
e764d19b9e | ||
|
|
3c06f00fee | ||
|
|
d1e5f47e29 | ||
|
|
503373bc53 | ||
|
|
988b828240 | ||
|
|
a4b4c9711d | ||
|
|
391c6e75bb | ||
|
|
ecdb034302 | ||
|
|
a0155be07f | ||
|
|
677b83cd96 | ||
|
|
6d0ac40a80 | ||
|
|
21cae258bf | ||
|
|
82534a7cba | ||
|
|
93d72503dc | ||
|
|
0820787fc6 | ||
|
|
ae9a5b5fdf | ||
|
|
41e2c0f61d | ||
|
|
40d2eb9b1a | ||
|
|
4203301734 | ||
|
|
f420e47ea5 | ||
|
|
3050c9a340 | ||
|
|
99d98ac5e8 | ||
|
|
d1af8a01ea | ||
|
|
62e640b3c0 | ||
|
|
701400d06f | ||
|
|
d93b03eb1a | ||
|
|
4fde7a92dc | ||
|
|
ca31fc1f8f | ||
|
|
ef241ad443 | ||
|
|
8155c13401 | ||
|
|
9dba28d156 | ||
|
|
ecb6f4de63 | ||
|
|
647e9ed859 | ||
|
|
7a0e9ff317 | ||
|
|
02501b4775 | ||
|
|
4d2962a9e5 | ||
|
|
e29a44bac4 | ||
|
|
0746d77e2d | ||
|
|
545cc041a9 | ||
|
|
65b9bf19b3 | ||
|
|
dd62e638df |
7
.travis.yml
Normal file
7
.travis.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
language: objective-c
|
||||
osx_image: xcode7.2
|
||||
podfile: ObjectiveCExample/Podfile
|
||||
xcode_workspace: ObjectiveCExample/ObjectiveCExample.xcworkspace
|
||||
xcode_scheme: ObjectiveCExample
|
||||
script:
|
||||
- xctool -workspace ObjectiveCExample/ObjectiveCExample.xcworkspace -scheme ObjectiveCExample -sdk iphonesimulator clean test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
|
||||
@@ -7,6 +7,7 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
09C572016004B12D6A6F9BFD /* Pods_ObjectiveCExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BC9C4E518D9F4FF7C026523 /* Pods_ObjectiveCExampleTests.framework */; };
|
||||
60F2CD131F797840FEEF41BF /* Pods_ObjectiveCExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E647562E4F5D61128404422A /* Pods_ObjectiveCExample.framework */; };
|
||||
8DFE19EF1BDA9FF300709011 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19EE1BDA9FF300709011 /* main.m */; };
|
||||
8DFE19F21BDA9FF300709011 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19F11BDA9FF300709011 /* AppDelegate.m */; };
|
||||
@@ -32,6 +33,7 @@
|
||||
8DFE1A341BDAA10100709011 /* 5.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A241BDAA10100709011 /* 5.m4a */; };
|
||||
8DFE1A351BDAA10100709011 /* 6.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A251BDAA10100709011 /* 6.m4a */; };
|
||||
8DFE1A361BDAA10100709011 /* 7.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE1A261BDAA10100709011 /* 7.m4a */; };
|
||||
F7D6D86D1CFB2C4900DA6DA6 /* Sample Data in Resources */ = {isa = PBXBuildFile; fileRef = F7D6D86C1CFB2C4900DA6DA6 /* Sample Data */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -46,6 +48,7 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
78F9C8623D65380774875E92 /* Pods-ObjectiveCExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ObjectiveCExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
7BC9C4E518D9F4FF7C026523 /* Pods_ObjectiveCExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ObjectiveCExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8DFE19EA1BDA9FF300709011 /* ObjectiveCExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ObjectiveCExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8DFE19EE1BDA9FF300709011 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
8DFE19F01BDA9FF300709011 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
@@ -77,8 +80,11 @@
|
||||
8DFE1A241BDAA10100709011 /* 5.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = 5.m4a; sourceTree = "<group>"; };
|
||||
8DFE1A251BDAA10100709011 /* 6.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = 6.m4a; sourceTree = "<group>"; };
|
||||
8DFE1A261BDAA10100709011 /* 7.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = 7.m4a; sourceTree = "<group>"; };
|
||||
B263C1FEBD2BEC1D1C4133CC /* Pods-ObjectiveCExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ObjectiveCExampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
BF4E88C3450A127B14A949C2 /* Pods-ObjectiveCExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ObjectiveCExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample.release.xcconfig"; sourceTree = "<group>"; };
|
||||
C12D647350722C151A02D17C /* Pods-ObjectiveCExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ObjectiveCExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
E647562E4F5D61128404422A /* Pods_ObjectiveCExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ObjectiveCExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F7D6D86C1CFB2C4900DA6DA6 /* Sample Data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Sample Data"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -94,6 +100,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
09C572016004B12D6A6F9BFD /* Pods_ObjectiveCExampleTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -105,6 +112,8 @@
|
||||
children = (
|
||||
78F9C8623D65380774875E92 /* Pods-ObjectiveCExample.debug.xcconfig */,
|
||||
BF4E88C3450A127B14A949C2 /* Pods-ObjectiveCExample.release.xcconfig */,
|
||||
C12D647350722C151A02D17C /* Pods-ObjectiveCExampleTests.debug.xcconfig */,
|
||||
B263C1FEBD2BEC1D1C4133CC /* Pods-ObjectiveCExampleTests.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
@@ -140,6 +149,7 @@
|
||||
8DFE19F91BDA9FF300709011 /* Assets.xcassets */,
|
||||
8DFE19FB1BDA9FF300709011 /* LaunchScreen.storyboard */,
|
||||
8DFE19FE1BDA9FF300709011 /* Info.plist */,
|
||||
F7D6D86C1CFB2C4900DA6DA6 /* Sample Data */,
|
||||
8DFE19ED1BDA9FF300709011 /* Supporting Files */,
|
||||
);
|
||||
path = ObjectiveCExample;
|
||||
@@ -200,6 +210,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E647562E4F5D61128404422A /* Pods_ObjectiveCExample.framework */,
|
||||
7BC9C4E518D9F4FF7C026523 /* Pods_ObjectiveCExampleTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -211,12 +222,12 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8DFE1A0C1BDA9FF300709011 /* Build configuration list for PBXNativeTarget "ObjectiveCExample" */;
|
||||
buildPhases = (
|
||||
B17DD0CEF4553EDB98836D32 /* Check Pods Manifest.lock */,
|
||||
B17DD0CEF4553EDB98836D32 /* [CP] Check Pods Manifest.lock */,
|
||||
8DFE19E61BDA9FF300709011 /* Sources */,
|
||||
8DFE19E71BDA9FF300709011 /* Frameworks */,
|
||||
8DFE19E81BDA9FF300709011 /* Resources */,
|
||||
CA0F9A9BDCCC5F900FD55CF3 /* Embed Pods Frameworks */,
|
||||
8328CABE589F0AEC0D43D7CC /* Copy Pods Resources */,
|
||||
CA0F9A9BDCCC5F900FD55CF3 /* [CP] Embed Pods Frameworks */,
|
||||
8328CABE589F0AEC0D43D7CC /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -231,9 +242,12 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8DFE1A0F1BDA9FF300709011 /* Build configuration list for PBXNativeTarget "ObjectiveCExampleTests" */;
|
||||
buildPhases = (
|
||||
3849EE691EA1B366503B4C96 /* [CP] Check Pods Manifest.lock */,
|
||||
8DFE19FF1BDA9FF300709011 /* Sources */,
|
||||
8DFE1A001BDA9FF300709011 /* Frameworks */,
|
||||
8DFE1A011BDA9FF300709011 /* Resources */,
|
||||
486F364061BAD3921A1CA2C8 /* [CP] Embed Pods Frameworks */,
|
||||
ED17275C640D443076C514CE /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -289,6 +303,7 @@
|
||||
8DFE19FD1BDA9FF300709011 /* LaunchScreen.storyboard in Resources */,
|
||||
8DFE19FA1BDA9FF300709011 /* Assets.xcassets in Resources */,
|
||||
8DFE19F81BDA9FF300709011 /* Main.storyboard in Resources */,
|
||||
F7D6D86D1CFB2C4900DA6DA6 /* Sample Data in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -318,14 +333,44 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
8328CABE589F0AEC0D43D7CC /* Copy Pods Resources */ = {
|
||||
3849EE691EA1B366503B4C96 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Copy Pods Resources";
|
||||
name = "[CP] 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 # 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";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
486F364061BAD3921A1CA2C8 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
8328CABE589F0AEC0D43D7CC /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -333,29 +378,29 @@
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
B17DD0CEF4553EDB98836D32 /* Check Pods Manifest.lock */ = {
|
||||
B17DD0CEF4553EDB98836D32 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Check Pods Manifest.lock";
|
||||
name = "[CP] 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";
|
||||
shellScript = "diff \"${PODS_ROOT}/../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";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
CA0F9A9BDCCC5F900FD55CF3 /* Embed Pods Frameworks */ = {
|
||||
CA0F9A9BDCCC5F900FD55CF3 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Embed Pods Frameworks";
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -363,6 +408,21 @@
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExample/Pods-ObjectiveCExample-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
ED17275C640D443076C514CE /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ObjectiveCExampleTests/Pods-ObjectiveCExampleTests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@@ -523,6 +583,7 @@
|
||||
};
|
||||
8DFE1A101BDA9FF300709011 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C12D647350722C151A02D17C /* Pods-ObjectiveCExampleTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;
|
||||
@@ -535,6 +596,7 @@
|
||||
};
|
||||
8DFE1A111BDA9FF300709011 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = B263C1FEBD2BEC1D1C4133CC /* Pods-ObjectiveCExampleTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = ObjectiveCExampleTests/Info.plist;
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0730"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DFE19E91BDA9FF300709011"
|
||||
BuildableName = "ObjectiveCExample.app"
|
||||
BlueprintName = "ObjectiveCExample"
|
||||
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DFE1A021BDA9FF300709011"
|
||||
BuildableName = "ObjectiveCExampleTests.xctest"
|
||||
BlueprintName = "ObjectiveCExampleTests"
|
||||
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DFE19E91BDA9FF300709011"
|
||||
BuildableName = "ObjectiveCExample.app"
|
||||
BlueprintName = "ObjectiveCExample"
|
||||
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DFE19E91BDA9FF300709011"
|
||||
BuildableName = "ObjectiveCExample.app"
|
||||
BlueprintName = "ObjectiveCExample"
|
||||
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DFE19E91BDA9FF300709011"
|
||||
BuildableName = "ObjectiveCExample.app"
|
||||
BlueprintName = "ObjectiveCExample"
|
||||
ReferencedContainer = "container:ObjectiveCExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -59,6 +59,11 @@
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
@@ -15,8 +16,95 @@
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uTp-oA-6Sj">
|
||||
<rect key="frame" x="244" y="84" width="113" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="113" id="4gB-hu-j54"/>
|
||||
<constraint firstAttribute="height" constant="30" id="ZCc-Jb-Nvy"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Zip Sample Data"/>
|
||||
<connections>
|
||||
<action selector="zipPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="ebf-WE-3Xz"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2Ts-JV-yCW">
|
||||
<rect key="frame" x="235" y="122" width="131" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="slo-YK-c1X"/>
|
||||
<constraint firstAttribute="width" constant="131" id="tp1-M2-kBk"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Unzip Sample Data"/>
|
||||
<connections>
|
||||
<action selector="unzipPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="6XQ-4q-0UI"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="84L-OB-eyZ">
|
||||
<rect key="frame" x="281" y="247" width="39" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="39" id="ZIK-Ed-EMM"/>
|
||||
<constraint firstAttribute="height" constant="30" id="kpA-B8-VhI"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Reset"/>
|
||||
<connections>
|
||||
<action selector="resetPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="8v0-hm-kIr"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="b0V-gX-SgI" userLabel="File3">
|
||||
<rect key="frame" x="60" y="218" width="480" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="OSM-wR-5Cr"/>
|
||||
<constraint firstAttribute="width" constant="480" id="Sm6-aF-Af6"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3gB-ZC-0ON" userLabel="File1">
|
||||
<rect key="frame" x="60" y="160" width="480" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="480" id="Ng7-H8-Pfv"/>
|
||||
<constraint firstAttribute="height" constant="21" id="yRA-t9-obB"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZxR-a0-kva" userLabel="File2">
|
||||
<rect key="frame" x="60" y="189" width="480" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="NgQ-SV-D07"/>
|
||||
<constraint firstAttribute="width" constant="480" id="yJ1-K6-arr"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="uTp-oA-6Sj" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="33K-W3-McX"/>
|
||||
<constraint firstItem="3gB-ZC-0ON" firstAttribute="top" secondItem="2Ts-JV-yCW" secondAttribute="bottom" constant="8" id="3iw-LW-JkX"/>
|
||||
<constraint firstItem="b0V-gX-SgI" firstAttribute="top" secondItem="ZxR-a0-kva" secondAttribute="bottom" constant="8" id="8Av-3o-ggw"/>
|
||||
<constraint firstItem="84L-OB-eyZ" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="B64-sj-Ihu"/>
|
||||
<constraint firstItem="b0V-gX-SgI" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="EEE-ae-qrN"/>
|
||||
<constraint firstItem="3gB-ZC-0ON" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="RQc-UF-4I6"/>
|
||||
<constraint firstItem="ZxR-a0-kva" firstAttribute="top" secondItem="3gB-ZC-0ON" secondAttribute="bottom" constant="8" id="bUv-Zd-r4D"/>
|
||||
<constraint firstItem="uTp-oA-6Sj" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="64" id="hwP-xO-UvR"/>
|
||||
<constraint firstItem="ZxR-a0-kva" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="jRJ-c6-8LV"/>
|
||||
<constraint firstItem="2Ts-JV-yCW" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="lEj-O2-aka"/>
|
||||
<constraint firstItem="2Ts-JV-yCW" firstAttribute="top" secondItem="uTp-oA-6Sj" secondAttribute="bottom" constant="8" id="mnz-Ae-5eG"/>
|
||||
<constraint firstItem="84L-OB-eyZ" firstAttribute="top" secondItem="b0V-gX-SgI" secondAttribute="bottom" constant="8" id="xAV-Uy-dqy"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="file1" destination="3gB-ZC-0ON" id="GUd-wx-xEa"/>
|
||||
<outlet property="file2" destination="ZxR-a0-kva" id="AZi-Dj-dI8"/>
|
||||
<outlet property="file3" destination="b0V-gX-SgI" id="zwq-l2-xZK"/>
|
||||
<outlet property="resetButton" destination="84L-OB-eyZ" id="9VY-KX-sKi"/>
|
||||
<outlet property="unzipButton" destination="2Ts-JV-yCW" id="2LN-kr-Sei"/>
|
||||
<outlet property="zipButton" destination="uTp-oA-6Sj" id="Tl8-0B-gHY"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# China to ban ivory trade
|
||||
|
||||
**HONG KONG** — It could be the beginning of the end for the illicit trade in ivory.
|
||||
|
||||
Last month, on a state visit to Washington, Chinese President Xi Jinping promised to stop the commercial trade in ivory in his country but gave few details about the timing and extent of such a move.
|
||||
|
||||
Now, a senior U.S. government official says that the Chinese ban could be in place within a year or so, with very narrow exceptions, describing it as a “huge” deal.
|
||||
|
||||
Such a move, conservationists say, would be a major step toward ending the poaching crisis that is decimating Africa’s elephant herds.
|
||||
9
ObjectiveCExample/ObjectiveCExample/Sample Data/Kerry in Syria.md
Executable file
9
ObjectiveCExample/ObjectiveCExample/Sample Data/Kerry in Syria.md
Executable file
@@ -0,0 +1,9 @@
|
||||
# Kerry in Syria
|
||||
|
||||
**VIENNA** — The war raging in Syria took center stage for Secretary of State John F. Kerry on Friday as he kicked off a series of meetings with diplomats seeking common ground on a strategy to resolve the grinding conflict.
|
||||
|
||||
But the foreign ministers of the three countries meeting with Kerry — Russia, Saudi Arabia and NATO-member Turkey — carry sharply competing views on how to proceed.
|
||||
|
||||
Saudi Arabia and Turkey, the neighboring country that has been overwhelmed with Syrian refugees, agree with Washington that Syrian President Bashar Al-Assad should eventually leave power.
|
||||
|
||||
Moscow is one of Assad’s biggest backers, and in recent weeks has positioned its military in Syria and conducted heavy airstrikes that have allowed Assad’s forces to resume ground offensives. The Russian military intervention also has alarmed the Pentagon, which is leading a separate air campaign against the Islamic State.
|
||||
BIN
ObjectiveCExample/ObjectiveCExample/Sample Data/wapo twitter banner.png
Executable file
BIN
ObjectiveCExample/ObjectiveCExample/Sample Data/wapo twitter banner.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
@@ -7,21 +7,124 @@
|
||||
//
|
||||
|
||||
#import "ViewController.h"
|
||||
#import "SSZipArchive.h"
|
||||
|
||||
@interface ViewController ()
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton *zipButton;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *unzipButton;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *resetButton;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *file1;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *file2;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *file3;
|
||||
@property (copy, nonatomic) NSString *zipPath;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ViewController
|
||||
|
||||
#pragma mark - Life Cycle
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
[super viewDidLoad];
|
||||
|
||||
_file1.text = @"";
|
||||
_file2.text = @"";
|
||||
_file3.text = @"";
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
[super didReceiveMemoryWarning];
|
||||
}
|
||||
|
||||
#pragma mark - IBAction
|
||||
- (IBAction)zipPressed:(id)sender {
|
||||
NSString *sampleDataPath = [[NSBundle mainBundle].bundleURL
|
||||
URLByAppendingPathComponent:@"Sample Data"
|
||||
isDirectory:YES].path;
|
||||
_zipPath = [self tempZipPath];
|
||||
BOOL success = [SSZipArchive createZipFileAtPath:_zipPath
|
||||
withContentsOfDirectory:sampleDataPath];
|
||||
if (success) {
|
||||
_unzipButton.enabled = YES;
|
||||
_zipButton.enabled = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)unzipPressed:(id)sender {
|
||||
if (!_zipPath) {
|
||||
return;
|
||||
}
|
||||
NSString *unzipPath = [self tempUnzipPath];
|
||||
if (!unzipPath) {
|
||||
return;
|
||||
}
|
||||
BOOL success = [SSZipArchive unzipFileAtPath:_zipPath
|
||||
toDestination:unzipPath];
|
||||
if (!success) {
|
||||
return;
|
||||
}
|
||||
NSError *error = nil;
|
||||
NSMutableArray<NSString *> *items = [[[NSFileManager defaultManager]
|
||||
contentsOfDirectoryAtPath:unzipPath
|
||||
error:&error] mutableCopy];
|
||||
if (error) {
|
||||
return;
|
||||
}
|
||||
[items enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
switch (idx) {
|
||||
case 0: {
|
||||
self.file1.text = obj;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
self.file2.text = obj;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
self.file3.text = obj;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
NSLog(@"Went beyond index of assumed files");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}];
|
||||
_unzipButton.enabled = NO;
|
||||
_resetButton.enabled = YES;
|
||||
}
|
||||
|
||||
- (IBAction)resetPressed:(id)sender {
|
||||
_file1.text = @"";
|
||||
_file2.text = @"";
|
||||
_file3.text = @"";
|
||||
_zipButton.enabled = YES;
|
||||
_unzipButton.enabled = NO;
|
||||
_resetButton.enabled = NO;
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
- (NSString *)tempZipPath {
|
||||
NSString *path = [NSString stringWithFormat:@"%@/\%@.zip",
|
||||
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0],
|
||||
[NSUUID UUID].UUIDString];
|
||||
return path;
|
||||
}
|
||||
|
||||
- (NSString *)tempUnzipPath {
|
||||
NSString *path = [NSString stringWithFormat:@"%@/\%@",
|
||||
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0],
|
||||
[NSUUID UUID].UUIDString];
|
||||
NSURL *url = [NSURL fileURLWithPath:path];
|
||||
NSError *error = nil;
|
||||
[[NSFileManager defaultManager] createDirectoryAtURL:url
|
||||
withIntermediateDirectories:YES
|
||||
attributes:nil
|
||||
error:&error];
|
||||
if (error) {
|
||||
return nil;
|
||||
}
|
||||
return url.path;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <SSZipArchive/SSZipArchive.h>
|
||||
#import "SSZipArchive.h"
|
||||
|
||||
/**
|
||||
* Test delegate by collecting its calls
|
||||
|
||||
@@ -173,6 +173,19 @@
|
||||
XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped");
|
||||
}
|
||||
|
||||
- (void)testPasswordCheck {
|
||||
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"];
|
||||
|
||||
BOOL protected = [SSZipArchive isFilePasswordProtectedAtPath:zipPath];
|
||||
XCTAssertFalse(protected, @"has no password");
|
||||
|
||||
|
||||
NSString *zipWithPasswordPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestPasswordArchive" ofType:@"zip"];
|
||||
|
||||
protected = [SSZipArchive isFilePasswordProtectedAtPath:zipWithPasswordPath];
|
||||
XCTAssertTrue(protected, @"has password");
|
||||
}
|
||||
|
||||
//Temp Disabled test, fix is not yet in the AES version of the unzip lib
|
||||
|
||||
//- (void)testUnzippingTruncatedFileFix {
|
||||
@@ -202,8 +215,8 @@
|
||||
|
||||
NSError *error = nil;
|
||||
NSDictionary *info = [[NSFileManager defaultManager] attributesOfItemAtPath: testSymlink error: &error];
|
||||
|
||||
XCTAssertTrue(info, @"Symbolic links should persist from the original archive to the outputted files.");
|
||||
BOOL fileIsSymbolicLink = info[NSFileType] == NSFileTypeSymbolicLink;
|
||||
XCTAssertTrue(fileIsSymbolicLink, @"Symbolic links should persist from the original archive to the outputted files.");
|
||||
}
|
||||
|
||||
- (void)testUnzippingWithRelativeSymlink {
|
||||
@@ -220,13 +233,13 @@
|
||||
NSString *testSymlinkFolder = [NSString pathWithComponents:@[testBasePath, subfolderName, @"folderSymlink"]];
|
||||
NSString *testSymlinkFile = [NSString pathWithComponents:@[testBasePath, subfolderName, @"fileSymlink"]];
|
||||
|
||||
BOOL found = [[NSFileManager defaultManager] attributesOfItemAtPath: testSymlinkFile error: nil];
|
||||
NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:testSymlinkFile error: nil];
|
||||
BOOL fileIsSymbolicLink = fileAttributes[NSFileType] == NSFileTypeSymbolicLink;
|
||||
XCTAssertTrue(fileIsSymbolicLink, @"Relative symbolic links should persist from the original archive to the outputted files.");
|
||||
|
||||
XCTAssertTrue(found, @"Relative symbolic links should persist from the original archive to the outputted files (and also remain relative).");
|
||||
|
||||
found = [[NSFileManager defaultManager] attributesOfItemAtPath: testSymlinkFolder error: nil];
|
||||
|
||||
XCTAssertTrue(found, @"Relative symbolic links should persist from the original archive to the outputted files (and also remain relative).");
|
||||
NSDictionary *folderAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:testSymlinkFolder error: nil];
|
||||
BOOL folderIsSymbolicLink = folderAttributes[NSFileType] == NSFileTypeSymbolicLink;
|
||||
XCTAssertTrue(folderIsSymbolicLink, @"Relative symbolic links should persist from the original archive to the outputted files.");
|
||||
}
|
||||
|
||||
- (void)testUnzippingWithUnicodeFilenameInside {
|
||||
|
||||
@@ -3,6 +3,14 @@ source 'https://github.com/CocoaPods/Specs.git'
|
||||
# inhibit_all_warnings!
|
||||
use_frameworks!
|
||||
|
||||
target 'ObjectiveCExample' do
|
||||
pod 'SSZipArchive', :path => '..'
|
||||
def testing_pods
|
||||
pod 'SSZipArchive', :path => '..'
|
||||
end
|
||||
|
||||
target 'ObjectiveCExample' do
|
||||
testing_pods
|
||||
end
|
||||
|
||||
target 'ObjectiveCExampleTests' do
|
||||
testing_pods
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
PODS:
|
||||
- SSZipArchive (1.1)
|
||||
- SSZipArchive (1.6)
|
||||
|
||||
DEPENDENCIES:
|
||||
- SSZipArchive (from `..`)
|
||||
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
|
||||
:path: ".."
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
SSZipArchive: 764254a5927195a5e7caea30cdc1afd3ea6732c5
|
||||
SSZipArchive: e3560652173f5fe708a835632e63e38b9000bdb7
|
||||
|
||||
PODFILE CHECKSUM: f060f800d651f1416cf88d195123f53e9462d745
|
||||
PODFILE CHECKSUM: ae5fb993e5dc339b15e10067d1e60549fa585f32
|
||||
|
||||
COCOAPODS: 1.0.0.beta.2
|
||||
COCOAPODS: 1.1.0.rc.1
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
[](https://travis-ci.org/ZipArchive/ZipArchive)
|
||||
|
||||
# SSZipArchive
|
||||
|
||||
ZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac.
|
||||
@@ -38,7 +40,9 @@ SSZipArchive requires ARC.
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination: unzipPath];
|
||||
```
|
||||
|
||||
### Swift
|
||||
### Swift (Swift 3 Only)
|
||||
|
||||
(For Swift 2.3 and below support please use continue to use version 1.4 or 1.5)
|
||||
|
||||
```swift
|
||||
// Create
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'SSZipArchive'
|
||||
s.version = '1.2'
|
||||
s.version = '1.6'
|
||||
s.summary = 'Utility class for zipping and unzipping files on iOS, tvOS, watchOS, and Mac.'
|
||||
s.description = 'SSZipArchive is a simple utility class for zipping and unzipping files on iOS, tvOS, watchOS, and Mac.'
|
||||
s.homepage = 'https://github.com/ZipArchive/ZipArchive'
|
||||
|
||||
25
SSZipArchive/SSZipArchive+Swift.swift
Normal file
25
SSZipArchive/SSZipArchive+Swift.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// SSZipArchive+Swift.swift
|
||||
// ZipArchive
|
||||
//
|
||||
// Created by William Dunay on 7/6/16.
|
||||
// Copyright © 2016 smumryak. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension SSZipArchive {
|
||||
|
||||
static func unzipFileAtPath(_ path: String, toDestination destination: String, overwrite: Bool, password: String?, delegate: SSZipArchiveDelegate?) throws -> Bool {
|
||||
|
||||
var success = false
|
||||
var error: NSError?
|
||||
|
||||
success = __unzipFile(atPath: path, toDestination: destination, overwrite: overwrite, password: password, error: &error, delegate: delegate)
|
||||
if let throwableError = error {
|
||||
throw throwableError
|
||||
}
|
||||
|
||||
return success
|
||||
}
|
||||
}
|
||||
@@ -10,18 +10,31 @@
|
||||
#define _SSZIPARCHIVE_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#include "Common.h"
|
||||
#include "SSZipCommon.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SSZipArchiveDelegate;
|
||||
|
||||
@interface SSZipArchive : NSObject
|
||||
|
||||
// Password check
|
||||
+ (BOOL)isFilePasswordProtectedAtPath:(NSString *)path;
|
||||
|
||||
// Unzip
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination;
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(id<SSZipArchiveDelegate>)delegate;
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id<SSZipArchiveDelegate>)delegate;
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError * *)error;
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError * *)error delegate:(id<SSZipArchiveDelegate>)delegate;
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error;
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error delegate:(nullable id<SSZipArchiveDelegate>)delegate NS_REFINED_FOR_SWIFT;
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
preserveAttributes:(BOOL)preserveAttributes
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(nullable NSString *)password
|
||||
error:(NSError * *)error
|
||||
delegate:(nullable id<SSZipArchiveDelegate>)delegate;
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
@@ -31,7 +44,7 @@
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(NSString *)password
|
||||
password:(nullable NSString *)password
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler;
|
||||
|
||||
@@ -40,19 +53,20 @@
|
||||
// without password
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirector;
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory;
|
||||
|
||||
// with password, password could be nil
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(NSString *)password;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(NSString *)password;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(NSString *)password;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password;
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password;
|
||||
|
||||
- (instancetype)initWithPath:(NSString *)path;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL open;
|
||||
- (BOOL)writeFile:(NSString *)path withPassword:(NSString *)password;
|
||||
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(NSString *)password;
|
||||
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(NSString *)fileName withPassword:(NSString *)password;
|
||||
- (BOOL)writeData:(NSData *)data filename:(NSString *)filename withPassword:(NSString *)password;
|
||||
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
|
||||
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password;
|
||||
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password;
|
||||
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL close;
|
||||
|
||||
@end
|
||||
@@ -74,4 +88,6 @@
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif /* _SSZIPARCHIVE_H */
|
||||
|
||||
@@ -26,6 +26,39 @@
|
||||
zipFile _zip;
|
||||
}
|
||||
|
||||
#pragma mark - Password check
|
||||
|
||||
+ (BOOL)isFilePasswordProtectedAtPath:(NSString *)path {
|
||||
// Begin opening
|
||||
zipFile zip = unzOpen((const char*)[path UTF8String]);
|
||||
if (zip == NULL) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
int ret = unzGoToFirstFile(zip);
|
||||
if (ret == UNZ_OK) {
|
||||
do {
|
||||
ret = unzOpenCurrentFile(zip);
|
||||
if( ret!=UNZ_OK ) {
|
||||
return NO;
|
||||
}
|
||||
unz_file_info fileInfo ={0};
|
||||
ret = unzGetCurrentFileInfo(zip, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
|
||||
if (ret!= UNZ_OK) {
|
||||
return NO;
|
||||
} else if((fileInfo.flag & 1) == 1) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
unzCloseCurrentFile(zip);
|
||||
ret = unzGoToNextFile(zip);
|
||||
} while( ret==UNZ_OK && UNZ_OK!=UNZ_END_OF_LIST_OF_FILE );
|
||||
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark - Unzipping
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination
|
||||
@@ -33,19 +66,19 @@
|
||||
return [self unzipFileAtPath:path toDestination:destination delegate:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError **)error
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError **)error
|
||||
{
|
||||
return [self unzipFileAtPath:path toDestination:destination overwrite:overwrite password:password error:error delegate:nil progressHandler:nil completionHandler:nil];
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:overwrite password:password error:error delegate:nil progressHandler:nil completionHandler:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(id<SSZipArchiveDelegate>)delegate
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id<SSZipArchiveDelegate>)delegate
|
||||
{
|
||||
return [self unzipFileAtPath:path toDestination:destination overwrite:YES password:nil error:nil delegate:delegate progressHandler:nil completionHandler:nil];
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:YES password:nil error:nil delegate:delegate progressHandler:nil completionHandler:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError **)error delegate:(id<SSZipArchiveDelegate>)delegate
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError **)error delegate:(nullable id<SSZipArchiveDelegate>)delegate
|
||||
{
|
||||
return [self unzipFileAtPath:path toDestination:destination overwrite:overwrite password:password error:error delegate:delegate progressHandler:nil completionHandler:nil];
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:overwrite password:password error:error delegate:delegate progressHandler:nil completionHandler:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
@@ -55,7 +88,7 @@
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler
|
||||
{
|
||||
return [self unzipFileAtPath:path toDestination:destination overwrite:overwrite password:password error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:overwrite password:password error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
|
||||
}
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
@@ -63,11 +96,23 @@
|
||||
progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
||||
completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler
|
||||
{
|
||||
return [self unzipFileAtPath:path toDestination:destination overwrite:YES password:nil error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:YES overwrite:YES password:nil error:nil delegate:nil progressHandler:progressHandler completionHandler:completionHandler];
|
||||
}
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
preserveAttributes:(BOOL)preserveAttributes
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(nullable NSString *)password
|
||||
error:(NSError * *)error
|
||||
delegate:(nullable id<SSZipArchiveDelegate>)delegate
|
||||
{
|
||||
return [self unzipFileAtPath:path toDestination:destination preserveAttributes:preserveAttributes overwrite:overwrite password:password error:error delegate:delegate progressHandler:nil completionHandler:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)unzipFileAtPath:(NSString *)path
|
||||
toDestination:(NSString *)destination
|
||||
preserveAttributes:(BOOL)preserveAttributes
|
||||
overwrite:(BOOL)overwrite
|
||||
password:(NSString *)password
|
||||
error:(NSError **)error
|
||||
@@ -121,7 +166,7 @@
|
||||
int crc_ret =0;
|
||||
unsigned char buffer[4096] = {0};
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSMutableSet *directoriesModificationDates = [[NSMutableSet alloc] init];
|
||||
NSMutableArray *directoriesModificationDates = [[NSMutableArray alloc] init];
|
||||
|
||||
// Message delegate
|
||||
if ([delegate respondsToSelector:@selector(zipArchiveWillUnzipArchiveAtPath:zipInfo:)]) {
|
||||
@@ -132,6 +177,7 @@
|
||||
}
|
||||
|
||||
NSInteger currentFileNumber = 0;
|
||||
NSError *unzippingError;
|
||||
do {
|
||||
@autoreleasepool {
|
||||
if ([password length] == 0) {
|
||||
@@ -202,11 +248,19 @@
|
||||
|
||||
BOOL fileIsSymbolicLink = NO;
|
||||
if (((fileInfo.version >> 8) == ZipUNIXVersion) && BSD_IFLNK == (BSD_SFMT & (fileInfo.external_fa >> 16))) {
|
||||
fileIsSymbolicLink = NO;
|
||||
fileIsSymbolicLink = YES;
|
||||
}
|
||||
|
||||
// Check if it contains directory
|
||||
NSString *strPath = @(filename);
|
||||
// NSString * strPath = @(filename);
|
||||
NSString * strPath = [NSString stringWithCString:filename encoding:NSUTF8StringEncoding];
|
||||
//if filename contains chinese dir transform Encoding
|
||||
if (!strPath) {
|
||||
NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
|
||||
strPath = [NSString stringWithCString:filename encoding:enc];
|
||||
}
|
||||
//end by skyfox
|
||||
|
||||
BOOL isDirectory = NO;
|
||||
if (filename[fileInfo.size_filename-1] == '/' || filename[fileInfo.size_filename-1] == '\\') {
|
||||
isDirectory = YES;
|
||||
@@ -218,23 +272,39 @@
|
||||
strPath = [strPath stringByReplacingOccurrencesOfString:@"\\" withString:@"/"];
|
||||
}
|
||||
|
||||
NSString *fullPath = [destination stringByAppendingPathComponent:strPath];
|
||||
NSError *err = nil;
|
||||
NSDate *modDate = [[self class] _dateWithMSDOSFormat:(UInt32)fileInfo.dosDate];
|
||||
NSDictionary *directoryAttr = @{NSFileCreationDate: modDate, NSFileModificationDate: modDate};
|
||||
NSString *fullPath;
|
||||
BOOL isDir = NO;
|
||||
if([[NSFileManager defaultManager]
|
||||
fileExistsAtPath:destination isDirectory:&isDir] && isDir){
|
||||
fullPath = [destination stringByAppendingPathComponent:strPath];
|
||||
}
|
||||
else {
|
||||
fullPath = destination;
|
||||
}
|
||||
|
||||
NSError *err = nil;
|
||||
NSDictionary *directoryAttr;
|
||||
if (preserveAttributes) {
|
||||
NSDate *modDate = [[self class] _dateWithMSDOSFormat:(UInt32)fileInfo.dosDate];
|
||||
directoryAttr = @{NSFileCreationDate: modDate, NSFileModificationDate: modDate};
|
||||
[directoriesModificationDates addObject: @{@"path": fullPath, @"modDate": modDate}];
|
||||
}
|
||||
if (isDirectory) {
|
||||
[fileManager createDirectoryAtPath:fullPath withIntermediateDirectories:YES attributes:directoryAttr error:&err];
|
||||
} else {
|
||||
[fileManager createDirectoryAtPath:[fullPath stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:directoryAttr error:&err];
|
||||
}
|
||||
if (nil != err) {
|
||||
if ([err.domain isEqualToString:NSCocoaErrorDomain] &&
|
||||
err.code == 640) {
|
||||
unzippingError = err;
|
||||
unzCloseCurrentFile(zip);
|
||||
success = NO;
|
||||
break;
|
||||
}
|
||||
NSLog(@"[SSZipArchive] Error: %@", err.localizedDescription);
|
||||
}
|
||||
|
||||
if(!fileIsSymbolicLink)
|
||||
[directoriesModificationDates addObject: @{@"path": fullPath, @"modDate": modDate}];
|
||||
|
||||
if ([fileManager fileExistsAtPath:fullPath] && !isDirectory && !overwrite) {
|
||||
//FIXME: couldBe CRC Check?
|
||||
unzCloseCurrentFile(zip);
|
||||
@@ -257,47 +327,63 @@
|
||||
if (fp) {
|
||||
if ([[[fullPath pathExtension] lowercaseString] isEqualToString:@"zip"]) {
|
||||
NSLog(@"Unzipping nested .zip file: %@", [fullPath lastPathComponent]);
|
||||
if ([self unzipFileAtPath:fullPath toDestination:[fullPath stringByDeletingLastPathComponent] overwrite:overwrite password:password error:nil delegate:nil]) {
|
||||
if ([self unzipFileAtPath:fullPath toDestination:[fullPath stringByDeletingLastPathComponent] overwrite:overwrite password:password error:nil delegate:nil ]) {
|
||||
[[NSFileManager defaultManager] removeItemAtPath:fullPath error:nil];
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
// Set the original datetime property
|
||||
if (fileInfo.dosDate != 0) {
|
||||
NSDate *orgDate = [[self class] _dateWithMSDOSFormat:(UInt32)fileInfo.dosDate];
|
||||
NSDictionary *attr = @{NSFileModificationDate: orgDate};
|
||||
if (preserveAttributes) {
|
||||
|
||||
if (attr) {
|
||||
if ([fileManager setAttributes:attr ofItemAtPath:fullPath error:nil] == NO) {
|
||||
// Can't set attributes
|
||||
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting modification date");
|
||||
// Set the original datetime property
|
||||
if (fileInfo.dosDate != 0) {
|
||||
NSDate *orgDate = [[self class] _dateWithMSDOSFormat:(UInt32)fileInfo.dosDate];
|
||||
NSDictionary *attr = @{NSFileModificationDate: orgDate};
|
||||
|
||||
if (attr) {
|
||||
if ([fileManager setAttributes:attr ofItemAtPath:fullPath error:nil] == NO) {
|
||||
// Can't set attributes
|
||||
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting modification date");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the original permissions on the file
|
||||
uLong permissions = fileInfo.external_fa >> 16;
|
||||
if (permissions != 0) {
|
||||
// Store it into a NSNumber
|
||||
NSNumber *permissionsValue = @(permissions);
|
||||
|
||||
// Retrieve any existing attributes
|
||||
NSMutableDictionary *attrs = [[NSMutableDictionary alloc] initWithDictionary:[fileManager attributesOfItemAtPath:fullPath error:nil]];
|
||||
|
||||
// Set the value in the attributes dict
|
||||
attrs[NSFilePosixPermissions] = permissionsValue;
|
||||
|
||||
// Update attributes
|
||||
if ([fileManager setAttributes:attrs ofItemAtPath:fullPath error:nil] == NO) {
|
||||
// Unable to set the permissions attribute
|
||||
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting permissions");
|
||||
}
|
||||
|
||||
// Set the original permissions on the file
|
||||
uLong permissions = fileInfo.external_fa >> 16;
|
||||
if (permissions != 0) {
|
||||
// Store it into a NSNumber
|
||||
NSNumber *permissionsValue = @(permissions);
|
||||
|
||||
// Retrieve any existing attributes
|
||||
NSMutableDictionary *attrs = [[NSMutableDictionary alloc] initWithDictionary:[fileManager attributesOfItemAtPath:fullPath error:nil]];
|
||||
|
||||
// Set the value in the attributes dict
|
||||
attrs[NSFilePosixPermissions] = permissionsValue;
|
||||
|
||||
// Update attributes
|
||||
if ([fileManager setAttributes:attrs ofItemAtPath:fullPath error:nil] == NO) {
|
||||
// Unable to set the permissions attribute
|
||||
NSLog(@"[SSZipArchive] Failed to set attributes - whilst setting permissions");
|
||||
}
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
[attrs release];
|
||||
[attrs release];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if we couldn't open file descriptor we can validate global errno to see the reason
|
||||
if (errno == ENOSPC) {
|
||||
NSError *enospcError = [NSError errorWithDomain:NSPOSIXErrorDomain
|
||||
code:ENOSPC
|
||||
userInfo:nil];
|
||||
unzippingError = enospcError;
|
||||
unzCloseCurrentFile(zip);
|
||||
success = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -353,19 +439,20 @@
|
||||
// The process of decompressing the .zip archive causes the modification times on the folders
|
||||
// to be set to the present time. So, when we are done, they need to be explicitly set.
|
||||
// set the modification date on all of the directories.
|
||||
NSError * err = nil;
|
||||
for (NSDictionary * d in directoriesModificationDates) {
|
||||
if (![[NSFileManager defaultManager] setAttributes:@{NSFileModificationDate: d[@"modDate"]} ofItemAtPath:d[@"path"] error:&err]) {
|
||||
NSLog(@"[SSZipArchive] Set attributes failed for directory: %@.", d[@"path"]);
|
||||
if (success && preserveAttributes) {
|
||||
NSError * err = nil;
|
||||
for (NSDictionary * d in directoriesModificationDates) {
|
||||
if (![[NSFileManager defaultManager] setAttributes:@{NSFileModificationDate: d[@"modDate"]} ofItemAtPath:d[@"path"] error:&err]) {
|
||||
NSLog(@"[SSZipArchive] Set attributes failed for directory: %@.", d[@"path"]);
|
||||
}
|
||||
if (err) {
|
||||
NSLog(@"[SSZipArchive] Error setting directory file modification date attribute: %@",err.localizedDescription);
|
||||
}
|
||||
}
|
||||
if (err) {
|
||||
NSLog(@"[SSZipArchive] Error setting directory file modification date attribute: %@",err.localizedDescription);
|
||||
}
|
||||
}
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
[directoriesModificationDates release];
|
||||
[directoriesModificationDates release];
|
||||
#endif
|
||||
}
|
||||
|
||||
// Message delegate
|
||||
if (success && [delegate respondsToSelector:@selector(zipArchiveDidUnzipArchiveAtPath:zipInfo:unzippedPath:)]) {
|
||||
@@ -382,13 +469,24 @@
|
||||
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"crc check failed for file"};
|
||||
retErr = [NSError errorWithDomain:@"SSZipArchiveErrorDomain" code:-3 userInfo:userInfo];
|
||||
}
|
||||
if (error)
|
||||
{
|
||||
*error = retErr;
|
||||
|
||||
if (error) {
|
||||
if (unzippingError) {
|
||||
*error = unzippingError;
|
||||
}
|
||||
else {
|
||||
*error = retErr;
|
||||
}
|
||||
}
|
||||
if (completionHandler)
|
||||
{
|
||||
completionHandler(path, success, retErr);
|
||||
if (unzippingError) {
|
||||
completionHandler(path, success, unzippingError);
|
||||
}
|
||||
else
|
||||
{
|
||||
completionHandler(path, success, retErr);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -402,8 +500,8 @@
|
||||
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath withPassword:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirector{
|
||||
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:keepParentDirector withPassword:nil];
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory{
|
||||
return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:keepParentDirectory withPassword:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(NSString *)password
|
||||
@@ -424,12 +522,12 @@
|
||||
return success;
|
||||
}
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(NSString *)password{
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password{
|
||||
return [self createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:NO withPassword:password];
|
||||
}
|
||||
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(NSString *)password{
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password{
|
||||
BOOL success = NO;
|
||||
|
||||
NSFileManager *fileManager = nil;
|
||||
@@ -518,7 +616,7 @@
|
||||
zipInfo->tmz_date.tm_year = (unsigned int)components.year;
|
||||
}
|
||||
|
||||
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(NSString *)password
|
||||
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password
|
||||
{
|
||||
NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened");
|
||||
|
||||
@@ -559,7 +657,7 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)writeFile:(NSString *)path withPassword:(NSString *)password;
|
||||
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
|
||||
{
|
||||
return [self writeFileAtPath:path withFileName:nil withPassword:password];
|
||||
}
|
||||
@@ -567,7 +665,7 @@
|
||||
// supports writing files with logical folder/directory structure
|
||||
// *path* is the absolute path of the file that will be compressed
|
||||
// *fileName* is the relative name of the file how it is stored within the zip e.g. /folder/subfolder/text1.txt
|
||||
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(NSString *)fileName withPassword:(NSString *)password
|
||||
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password
|
||||
{
|
||||
NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened");
|
||||
|
||||
@@ -634,7 +732,7 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)writeData:(NSData *)data filename:(NSString *)filename withPassword:(NSString *)password;
|
||||
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
|
||||
{
|
||||
if (!_zip) {
|
||||
return NO;
|
||||
|
||||
@@ -78,4 +78,4 @@ typedef struct unz_global_info64
|
||||
unsigned long size_comment; /* size of the global comment of the zipfile */
|
||||
} unz_global_info64;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -17,4 +17,3 @@ FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[];
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <ZipArchive/PublicHeader.h>
|
||||
|
||||
#import "SSZipArchive.h"
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "zlib.h"
|
||||
#include "unzip.h"
|
||||
|
||||
#include "Common.h"
|
||||
#include "SSZipCommon.h"
|
||||
|
||||
#ifdef STDC
|
||||
# include <stddef.h>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
See the accompanying LICENSE file for the full text of the license.
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "SSZipCommon.h"
|
||||
|
||||
#ifndef _UNZ_H
|
||||
#define _UNZ_H
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
PODS:
|
||||
- SSZipArchive (1.0.1)
|
||||
- SSZipArchive (1.6)
|
||||
|
||||
DEPENDENCIES:
|
||||
- SSZipArchive (from `..`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
SSZipArchive:
|
||||
:path: ..
|
||||
:path: ".."
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
SSZipArchive: 7bfebbf578e47e1c4239a06f0c202101d4d933ab
|
||||
SSZipArchive: e3560652173f5fe708a835632e63e38b9000bdb7
|
||||
|
||||
COCOAPODS: 0.39.0
|
||||
PODFILE CHECKSUM: 8d38f966bef0580b1feb382672c12ef6a674ea58
|
||||
|
||||
COCOAPODS: 1.1.0.rc.1
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
2B4B246F1C21500E00CC99E5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19101BDA74F800709011 /* Main.storyboard */; };
|
||||
2B4B24701C21500E00CC99E5 /* Sample Data in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19461BDA82EA00709011 /* Sample Data */; };
|
||||
57AA942E1C28397000858D82 /* ZipArchive.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57AA942D1C28397000858D82 /* ZipArchive.framework */; };
|
||||
5914648EC4509E192D31CA42 /* Pods_SwiftExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E81180168B01E0210FE1E3F /* Pods_SwiftExample.framework */; };
|
||||
8DFE190D1BDA74F800709011 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE190C1BDA74F800709011 /* AppDelegate.swift */; };
|
||||
8DFE190F1BDA74F800709011 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE190E1BDA74F800709011 /* ViewController.swift */; };
|
||||
8DFE19121BDA74F800709011 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19101BDA74F800709011 /* Main.storyboard */; };
|
||||
@@ -24,6 +23,7 @@
|
||||
8DFE19221BDA74F800709011 /* SwiftExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19211BDA74F800709011 /* SwiftExampleTests.swift */; };
|
||||
8DFE19421BDA7D8D00709011 /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = 8DFE19391BDA7D8C00709011 /* mztools.c */; };
|
||||
8DFE19471BDA82EA00709011 /* Sample Data in Resources */ = {isa = PBXBuildFile; fileRef = 8DFE19461BDA82EA00709011 /* Sample Data */; };
|
||||
9C98C3B4F9B653B83DA9D5F1 /* Pods_SwiftExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B957B9DCEA770A395AA9EF69 /* Pods_SwiftExample.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -37,6 +37,7 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0212314D326774BDFEDFFEB1 /* Pods-SwiftExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.release.xcconfig"; sourceTree = "<group>"; };
|
||||
2B4B24761C21500E00CC99E5 /* SwiftExampleCarthage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftExampleCarthage.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2B4B247A1C21508900CC99E5 /* ZipArchive.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ZipArchive.framework; path = ../Carthage/Build/iOS/ZipArchive.framework; sourceTree = "<group>"; };
|
||||
57AA942D1C28397000858D82 /* ZipArchive.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ZipArchive.framework; path = Carthage/Build/iOS/ZipArchive.framework; sourceTree = "<group>"; };
|
||||
@@ -63,9 +64,8 @@
|
||||
8DFE193F1BDA7D8C00709011 /* SSZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSZipArchive.h; sourceTree = "<group>"; };
|
||||
8DFE19401BDA7D8D00709011 /* SSZipArchive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSZipArchive.m; sourceTree = "<group>"; };
|
||||
8DFE19461BDA82EA00709011 /* Sample Data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Sample Data"; sourceTree = "<group>"; };
|
||||
9E81180168B01E0210FE1E3F /* Pods_SwiftExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EDFB736C117CB42411E221E3 /* Pods-SwiftExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.release.xcconfig"; sourceTree = "<group>"; };
|
||||
FA88DF2AF701AB45DE8B7EB5 /* Pods-SwiftExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9F41DD1EB899AECA3DE54836 /* Pods-SwiftExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
B957B9DCEA770A395AA9EF69 /* Pods_SwiftExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -81,7 +81,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5914648EC4509E192D31CA42 /* Pods_SwiftExample.framework in Frameworks */,
|
||||
9C98C3B4F9B653B83DA9D5F1 /* Pods_SwiftExample.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -100,11 +100,20 @@
|
||||
children = (
|
||||
57AA942D1C28397000858D82 /* ZipArchive.framework */,
|
||||
2B4B247A1C21508900CC99E5 /* ZipArchive.framework */,
|
||||
9E81180168B01E0210FE1E3F /* Pods_SwiftExample.framework */,
|
||||
B957B9DCEA770A395AA9EF69 /* Pods_SwiftExample.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
54361C0DE261FF7F98753E58 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9F41DD1EB899AECA3DE54836 /* Pods-SwiftExample.debug.xcconfig */,
|
||||
0212314D326774BDFEDFFEB1 /* Pods-SwiftExample.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8DFE19001BDA74F800709011 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -112,8 +121,8 @@
|
||||
8DFE190B1BDA74F800709011 /* SwiftExample */,
|
||||
8DFE19201BDA74F800709011 /* SwiftExampleTests */,
|
||||
8DFE190A1BDA74F800709011 /* Products */,
|
||||
F5943061786EAFF4CAE16D45 /* Pods */,
|
||||
1B67DA700507825BD99DCEA7 /* Frameworks */,
|
||||
54361C0DE261FF7F98753E58 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -178,15 +187,6 @@
|
||||
path = minizip;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F5943061786EAFF4CAE16D45 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FA88DF2AF701AB45DE8B7EB5 /* Pods-SwiftExample.debug.xcconfig */,
|
||||
EDFB736C117CB42411E221E3 /* Pods-SwiftExample.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -212,12 +212,12 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8DFE19261BDA74F800709011 /* Build configuration list for PBXNativeTarget "SwiftExample" */;
|
||||
buildPhases = (
|
||||
E78B00A33CAF266DB67D6E49 /* Check Pods Manifest.lock */,
|
||||
ECE84F3FFB46950DAF6EE569 /* [CP] Check Pods Manifest.lock */,
|
||||
8DFE19051BDA74F800709011 /* Sources */,
|
||||
8DFE19061BDA74F800709011 /* Frameworks */,
|
||||
8DFE19071BDA74F800709011 /* Resources */,
|
||||
AEFD7A965DD623210F3FCEAA /* Embed Pods Frameworks */,
|
||||
D85ACD9C6E611B2AC2024437 /* Copy Pods Resources */,
|
||||
DCD3E35CEAE544A09342C9A1 /* [CP] Embed Pods Frameworks */,
|
||||
7D37585779E4135FA4161527 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -253,13 +253,15 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0710;
|
||||
LastUpgradeCheck = 0710;
|
||||
LastUpgradeCheck = 0800;
|
||||
TargetAttributes = {
|
||||
8DFE19081BDA74F800709011 = {
|
||||
CreatedOnToolsVersion = 7.1;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
8DFE191C1BDA74F800709011 = {
|
||||
CreatedOnToolsVersion = 7.1;
|
||||
LastSwiftMigration = 0800;
|
||||
TestTargetID = 8DFE19081BDA74F800709011;
|
||||
};
|
||||
};
|
||||
@@ -332,29 +334,14 @@
|
||||
shellScript = "/usr/local/bin/carthage copy-frameworks";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
AEFD7A965DD623210F3FCEAA /* Embed Pods Frameworks */ = {
|
||||
7D37585779E4135FA4161527 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
D85ACD9C6E611B2AC2024437 /* Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Copy Pods Resources";
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -362,19 +349,34 @@
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
E78B00A33CAF266DB67D6E49 /* Check Pods Manifest.lock */ = {
|
||||
DCD3E35CEAE544A09342C9A1 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Check Pods Manifest.lock";
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
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";
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
ECE84F3FFB46950DAF6EE569 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] 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 # 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";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
@@ -483,8 +485,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -528,8 +532,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -548,6 +554,7 @@
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
@@ -555,25 +562,27 @@
|
||||
};
|
||||
8DFE19271BDA74F800709011 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = FA88DF2AF701AB45DE8B7EB5 /* Pods-SwiftExample.debug.xcconfig */;
|
||||
baseConfigurationReference = 9F41DD1EB899AECA3DE54836 /* Pods-SwiftExample.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = SwiftExample/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8DFE19281BDA74F800709011 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = EDFB736C117CB42411E221E3 /* Pods-SwiftExample.release.xcconfig */;
|
||||
baseConfigurationReference = 0212314D326774BDFEDFFEB1 /* Pods-SwiftExample.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = SwiftExample/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -585,6 +594,7 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExampleTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftExample.app/SwiftExample";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -597,6 +607,7 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.SwiftExampleTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftExample.app/SwiftExample";
|
||||
};
|
||||
name = Release;
|
||||
|
||||
@@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(application: UIApplication) {
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(application: UIApplication) {
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(application: UIApplication) {
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(application: UIApplication) {
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(application: UIApplication) {
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
@@ -14,57 +16,61 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uwd-kM-cdh">
|
||||
<rect key="frame" x="244" y="51" width="113" height="30"/>
|
||||
<animations/>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uwd-kM-cdh">
|
||||
<state key="normal" title="Zip Sample Data"/>
|
||||
<connections>
|
||||
<action selector="zipPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="dQS-RP-2Yl"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XUJ-IR-RIS">
|
||||
<rect key="frame" x="235" y="89" width="131" height="30"/>
|
||||
<animations/>
|
||||
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XUJ-IR-RIS">
|
||||
<state key="normal" title="Unzip Sample Data"/>
|
||||
<connections>
|
||||
<action selector="unzipPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="gGR-nU-aS3"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Lbq-oS-Rlj">
|
||||
<rect key="frame" x="281" y="214" width="39" height="30"/>
|
||||
<animations/>
|
||||
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Lbq-oS-Rlj">
|
||||
<state key="normal" title="Reset"/>
|
||||
<connections>
|
||||
<action selector="resetPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="n8G-qy-egF"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="09F-6Q-slx" userLabel="File1">
|
||||
<rect key="frame" x="67" y="127" width="480" height="21"/>
|
||||
<animations/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="09F-6Q-slx" userLabel="File1">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PSK-Jd-Mwc" userLabel="File2">
|
||||
<rect key="frame" x="67" y="156" width="480" height="21"/>
|
||||
<animations/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PSK-Jd-Mwc" userLabel="File2">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pW5-rw-iqM" userLabel="File3">
|
||||
<rect key="frame" x="67" y="185" width="480" height="21"/>
|
||||
<animations/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pW5-rw-iqM" userLabel="File3">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="09F-6Q-slx" secondAttribute="trailing" constant="33" id="3S4-8t-aQA"/>
|
||||
<constraint firstItem="XUJ-IR-RIS" firstAttribute="centerX" secondItem="Lbq-oS-Rlj" secondAttribute="centerX" id="AYF-iB-SJU"/>
|
||||
<constraint firstItem="Uwd-kM-cdh" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="CTF-Hv-dt4"/>
|
||||
<constraint firstItem="XUJ-IR-RIS" firstAttribute="top" secondItem="Uwd-kM-cdh" secondAttribute="bottom" constant="8" symbolic="YES" id="OIr-Yf-tdY"/>
|
||||
<constraint firstItem="09F-6Q-slx" firstAttribute="trailing" secondItem="PSK-Jd-Mwc" secondAttribute="trailing" id="TGC-ob-dm0"/>
|
||||
<constraint firstItem="Uwd-kM-cdh" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="31" id="Uh0-R8-WFe"/>
|
||||
<constraint firstItem="pW5-rw-iqM" firstAttribute="top" secondItem="PSK-Jd-Mwc" secondAttribute="bottom" constant="8" symbolic="YES" id="VfM-Vg-Yai"/>
|
||||
<constraint firstItem="09F-6Q-slx" firstAttribute="top" secondItem="XUJ-IR-RIS" secondAttribute="bottom" constant="8" symbolic="YES" id="Wpv-VU-gb1"/>
|
||||
<constraint firstItem="Uwd-kM-cdh" firstAttribute="centerX" secondItem="XUJ-IR-RIS" secondAttribute="centerX" id="dW9-nF-tLe"/>
|
||||
<constraint firstItem="PSK-Jd-Mwc" firstAttribute="leading" secondItem="pW5-rw-iqM" secondAttribute="leading" id="eJr-2x-5k4"/>
|
||||
<constraint firstItem="09F-6Q-slx" firstAttribute="leading" secondItem="PSK-Jd-Mwc" secondAttribute="leading" id="ndV-Ni-q25"/>
|
||||
<constraint firstItem="Lbq-oS-Rlj" firstAttribute="top" secondItem="pW5-rw-iqM" secondAttribute="bottom" constant="8" symbolic="YES" id="qRj-kV-fEA"/>
|
||||
<constraint firstItem="09F-6Q-slx" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="47" id="rLi-aF-EpY"/>
|
||||
<constraint firstItem="PSK-Jd-Mwc" firstAttribute="top" secondItem="09F-6Q-slx" secondAttribute="bottom" constant="8" symbolic="YES" id="waq-c1-rAn"/>
|
||||
<constraint firstItem="PSK-Jd-Mwc" firstAttribute="trailing" secondItem="pW5-rw-iqM" secondAttribute="trailing" id="wix-Cp-XH9"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="file1" destination="09F-6Q-slx" id="Rmp-Xl-xfc"/>
|
||||
|
||||
@@ -39,13 +39,13 @@ class ViewController: UIViewController {
|
||||
// MARK: IBAction
|
||||
|
||||
@IBAction func zipPressed(_: UIButton) {
|
||||
let sampleDataPath = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent("Sample Data").path
|
||||
let sampleDataPath = Bundle.main.bundleURL.appendingPathComponent("Sample Data").path
|
||||
zipPath = tempZipPath()
|
||||
|
||||
let success = SSZipArchive.createZipFileAtPath(zipPath, withContentsOfDirectory: sampleDataPath)
|
||||
let success = SSZipArchive.createZipFile(atPath: zipPath!, withContentsOfDirectory: sampleDataPath)
|
||||
if success {
|
||||
unzipButton.enabled = true
|
||||
zipButton.enabled = false
|
||||
unzipButton.isEnabled = true
|
||||
zipButton.isEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,19 +58,19 @@ class ViewController: UIViewController {
|
||||
return
|
||||
}
|
||||
|
||||
let success = SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath)
|
||||
let success = SSZipArchive.unzipFile(atPath: zipPath, toDestination: unzipPath)
|
||||
if !success {
|
||||
return
|
||||
}
|
||||
|
||||
var items: [String]
|
||||
do {
|
||||
items = try NSFileManager.defaultManager().contentsOfDirectoryAtPath(unzipPath)
|
||||
items = try FileManager.default.contentsOfDirectory(atPath: unzipPath)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
for (index, item) in items.enumerate() {
|
||||
for (index, item) in items.enumerated() {
|
||||
switch index {
|
||||
case 0:
|
||||
file1.text = item
|
||||
@@ -83,43 +83,40 @@ class ViewController: UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
unzipButton.enabled = false
|
||||
resetButton.enabled = true
|
||||
unzipButton.isEnabled = false
|
||||
resetButton.isEnabled = true
|
||||
}
|
||||
|
||||
@IBAction func resetPressed(_: UIButton) {
|
||||
file1.text = ""
|
||||
file2.text = ""
|
||||
file3.text = ""
|
||||
zipButton.enabled = true
|
||||
unzipButton.enabled = false
|
||||
resetButton.enabled = false
|
||||
zipButton.isEnabled = true
|
||||
unzipButton.isEnabled = false
|
||||
resetButton.isEnabled = false
|
||||
}
|
||||
|
||||
// MARK: Private
|
||||
|
||||
func tempZipPath() -> String {
|
||||
var path = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true)[0]
|
||||
path += "/\(NSUUID().UUIDString).zip"
|
||||
var path = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0]
|
||||
path += "/\(UUID().uuidString).zip"
|
||||
return path
|
||||
}
|
||||
|
||||
func tempUnzipPath() -> String? {
|
||||
var path = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true)[0]
|
||||
path += "/\(NSUUID().UUIDString)"
|
||||
let url = NSURL(fileURLWithPath: path)
|
||||
var path = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0]
|
||||
path += "/\(UUID().uuidString)"
|
||||
let url = URL(fileURLWithPath: path)
|
||||
|
||||
do {
|
||||
try NSFileManager.defaultManager().createDirectoryAtURL(url, withIntermediateDirectories: true, attributes: nil)
|
||||
try FileManager.default.createDirectory(at: url, withIntermediateDirectories: true, attributes: nil)
|
||||
} catch {
|
||||
return nil
|
||||
}
|
||||
|
||||
if let path = url.path {
|
||||
return path
|
||||
}
|
||||
|
||||
return nil
|
||||
return url.path
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class SwiftExampleTests: XCTestCase {
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measureBlock {
|
||||
self.measure {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
01DB08731D88095600D335B9 /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 389869341D5BC30100F18782 /* SSZipCommon.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
389869351D5BC30100F18782 /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 389869341D5BC30100F18782 /* SSZipCommon.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
87ACF3EA1D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87ACF3E91D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift */; };
|
||||
AFF75A2D1C3727F000F450AC /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AFF75A2E1C37280200F450AC /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE481C0DF7950004A2F1 /* SSZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AFF75A2F1C37280200F450AC /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = B423AE491C0DF7950004A2F1 /* SSZipArchive.m */; };
|
||||
AFF75A301C37280900F450AC /* Common.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3C1C0DF7950004A2F1 /* Common.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AFF75A311C37281700F450AC /* aes.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE271C0DF7950004A2F1 /* aes.h */; };
|
||||
AFF75A321C37281700F450AC /* aes_via_ace.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE281C0DF7950004A2F1 /* aes_via_ace.h */; };
|
||||
AFF75A331C37281700F450AC /* aescrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE291C0DF7950004A2F1 /* aescrypt.c */; };
|
||||
@@ -63,7 +65,6 @@
|
||||
B423AE5D1C0DF7950004A2F1 /* pwd2key.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE391C0DF7950004A2F1 /* pwd2key.h */; };
|
||||
B423AE5E1C0DF7950004A2F1 /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE3A1C0DF7950004A2F1 /* sha1.c */; };
|
||||
B423AE5F1C0DF7950004A2F1 /* sha1.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3B1C0DF7950004A2F1 /* sha1.h */; };
|
||||
B423AE601C0DF7950004A2F1 /* Common.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3C1C0DF7950004A2F1 /* Common.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
B423AE621C0DF7950004A2F1 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE3F1C0DF7950004A2F1 /* crypt.h */; };
|
||||
B423AE631C0DF7950004A2F1 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = B423AE401C0DF7950004A2F1 /* ioapi.c */; };
|
||||
B423AE641C0DF7950004A2F1 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE411C0DF7950004A2F1 /* ioapi.h */; };
|
||||
@@ -80,6 +81,8 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
389869341D5BC30100F18782 /* SSZipCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSZipCommon.h; sourceTree = "<group>"; };
|
||||
87ACF3E91D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SSZipArchive+Swift.swift"; sourceTree = "<group>"; };
|
||||
AFF75A241C37279600F450AC /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B423AE1A1C0DF76A0004A2F1 /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B423AE271C0DF7950004A2F1 /* aes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aes.h; sourceTree = "<group>"; };
|
||||
@@ -103,7 +106,6 @@
|
||||
B423AE391C0DF7950004A2F1 /* pwd2key.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pwd2key.h; sourceTree = "<group>"; };
|
||||
B423AE3A1C0DF7950004A2F1 /* sha1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sha1.c; sourceTree = "<group>"; };
|
||||
B423AE3B1C0DF7950004A2F1 /* sha1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha1.h; sourceTree = "<group>"; };
|
||||
B423AE3C1C0DF7950004A2F1 /* Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = "<group>"; };
|
||||
B423AE3D1C0DF7950004A2F1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
B423AE3F1C0DF7950004A2F1 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypt.h; sourceTree = "<group>"; };
|
||||
B423AE401C0DF7950004A2F1 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioapi.c; sourceTree = "<group>"; };
|
||||
@@ -161,12 +163,13 @@
|
||||
B423AE251C0DF7950004A2F1 /* SSZipArchive */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
389869341D5BC30100F18782 /* SSZipCommon.h */,
|
||||
B423AE261C0DF7950004A2F1 /* aes */,
|
||||
B423AE3C1C0DF7950004A2F1 /* Common.h */,
|
||||
B423AE3D1C0DF7950004A2F1 /* Info.plist */,
|
||||
B423AE3E1C0DF7950004A2F1 /* minizip */,
|
||||
B423AE481C0DF7950004A2F1 /* SSZipArchive.h */,
|
||||
B423AE491C0DF7950004A2F1 /* SSZipArchive.m */,
|
||||
87ACF3E91D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift */,
|
||||
B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */,
|
||||
);
|
||||
path = SSZipArchive;
|
||||
@@ -228,6 +231,7 @@
|
||||
AFF75A311C37281700F450AC /* aes.h in Headers */,
|
||||
AFF75A3F1C37281700F450AC /* hmac.h in Headers */,
|
||||
AFF75A3D1C37281700F450AC /* fileenc.h in Headers */,
|
||||
01DB08731D88095600D335B9 /* SSZipCommon.h in Headers */,
|
||||
AFF75A2D1C3727F000F450AC /* ZipArchive.h in Headers */,
|
||||
AFF75A351C37281700F450AC /* aesopt.h in Headers */,
|
||||
AFF75A381C37281700F450AC /* brg_endian.h in Headers */,
|
||||
@@ -236,7 +240,6 @@
|
||||
AFF75A451C37281700F450AC /* sha1.h in Headers */,
|
||||
AFF75A4C1C37282700F450AC /* unzip.h in Headers */,
|
||||
AFF75A4A1C37282700F450AC /* mztools.h in Headers */,
|
||||
AFF75A301C37280900F450AC /* Common.h in Headers */,
|
||||
AFF75A371C37281700F450AC /* aestab.h in Headers */,
|
||||
AFF75A3B1C37281700F450AC /* entropy.h in Headers */,
|
||||
AFF75A481C37282700F450AC /* ioapi.h in Headers */,
|
||||
@@ -251,8 +254,8 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
B423AE6D1C0DF7950004A2F1 /* ZipArchive.h in Headers */,
|
||||
B423AE601C0DF7950004A2F1 /* Common.h in Headers */,
|
||||
B423AE6B1C0DF7950004A2F1 /* SSZipArchive.h in Headers */,
|
||||
389869351D5BC30100F18782 /* SSZipCommon.h in Headers */,
|
||||
B423AE6A1C0DF7950004A2F1 /* zip.h in Headers */,
|
||||
B423AE5F1C0DF7950004A2F1 /* sha1.h in Headers */,
|
||||
B423AE551C0DF7950004A2F1 /* entropy.h in Headers */,
|
||||
@@ -318,6 +321,7 @@
|
||||
B423AE111C0DF76A0004A2F1 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0730;
|
||||
LastUpgradeCheck = 0710;
|
||||
ORGANIZATIONNAME = smumryak;
|
||||
TargetAttributes = {
|
||||
@@ -326,6 +330,7 @@
|
||||
};
|
||||
B423AE191C0DF76A0004A2F1 = {
|
||||
CreatedOnToolsVersion = 7.1.1;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -392,6 +397,7 @@
|
||||
files = (
|
||||
B423AE5C1C0DF7950004A2F1 /* pwd2key.c in Sources */,
|
||||
B423AE581C0DF7950004A2F1 /* hmac.c in Sources */,
|
||||
87ACF3EA1D2DAFAD00ED2F7E /* SSZipArchive+Swift.swift in Sources */,
|
||||
B423AE4D1C0DF7950004A2F1 /* aescrypt.c in Sources */,
|
||||
B423AE5E1C0DF7950004A2F1 /* sha1.c in Sources */,
|
||||
B423AE631C0DF7950004A2F1 /* ioapi.c in Sources */,
|
||||
@@ -544,6 +550,7 @@
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = marker;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@@ -556,6 +563,8 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
|
||||
PRODUCT_NAME = "$(PROJECT_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -564,6 +573,7 @@
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = bitcode;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@@ -576,6 +586,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.ZipArchive;
|
||||
PRODUCT_NAME = "$(PROJECT_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -589,6 +600,7 @@
|
||||
AFF75A2B1C37279600F450AC /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
B423AE141C0DF76A0004A2F1 /* Build configuration list for PBXProject "ZipArchive" */ = {
|
||||
isa = XCConfigurationList;
|
||||
|
||||
Reference in New Issue
Block a user