46 Commits
v1.2 ... v1.6

Author SHA1 Message Date
Joshua Hudson
edc099d6be Update swift test project for swift 3 and xcode 8 2016-09-13 11:02:55 -07:00
Joshua Hudson
81c8672414 Update Readme.md 2016-09-13 10:45:08 -07:00
Joshua Hudson
df34c1b896 Merge pull request #281 from simerjots/dev-fileoption
Extended to allow passing in directory or file to unzip to
2016-09-13 10:43:41 -07:00
Joshua Hudson
79fd869347 Merge pull request #282 from pk/master
Convert Swift code in to Swift 3 and change appropriate project settings
2016-09-13 10:43:03 -07:00
Joshua Hudson
38c24c156a Merge pull request #284 from priya87/master
Added SSZipCommom.h to target ZipArchive-Mac
2016-09-13 10:41:41 -07:00
priya TIROUNARAYANANE
e764d19b9e Added SSZipCommom.h to target ZipArchive-Mac 2016-09-13 12:30:35 +02:00
Pavel Kunc
3c06f00fee Convert Swift code in to Swift 3 and change appropriate project
settings.
2016-09-13 09:17:31 +01:00
Sam Singh
d1e5f47e29 Extended to allow passing in directory or file to unzip to 2016-09-05 20:40:00 -04:00
Joshua Hudson
503373bc53 fix main source build 2016-08-10 13:19:07 -07:00
Joshua Hudson
988b828240 update podspec 2016-08-10 13:07:15 -07:00
Joshua Hudson
a4b4c9711d Merge pull request #273 from shaojiankui/master
if filename contains chinese dir transform Encoding
2016-08-10 10:50:14 -07:00
Jakey
391c6e75bb if filename contains chinese dir transform Encoding 2016-08-10 14:44:44 +08:00
Joshua Hudson
ecdb034302 Merge pull request #271 from dlahyani/feature/add-newline-at-eof
SSZipArchive: Make sure header files ends with a single \n character.
2016-08-08 08:30:00 -07:00
Daniel Lahyani
a0155be07f SSZipArchive: Make sure header files ends with a single \n character.
This is common practice silences a commonly used warning: 'Wnewline-eof'
2016-08-08 14:43:09 +03:00
Joshua Hudson
677b83cd96 update pod file 2016-08-03 16:14:30 -07:00
Joshua Hudson
6d0ac40a80 Rename Common.h to avoid conflicts with other Cocoapod projects 2016-08-03 16:08:42 -07:00
Joshua Hudson
21cae258bf podspec bump 2016-07-13 09:06:50 -07:00
Joshua Hudson
82534a7cba Merge pull request #264 from sibext/PerformanceImprovements
Performance improvements with zip files that have large amounts of files.
2016-07-13 09:02:47 -07:00
Joshua Hudson
93d72503dc Merge pull request #263 from sibext/SymlinkedFilesBug
Fix of symlinked files bug
2016-07-13 08:52:38 -07:00
Artyom Gladkov
0820787fc6 Add additional public unzipping method to allow skipping of operations on files' attributes.
Operations with files' attribute are performance bottleneck and for some tasks and archives it is overkill.
2016-07-13 14:15:13 +06:00
Artyom Gladkov
ae9a5b5fdf Change collection type for 'directoriesModificationDates' from NSMutableSet to NSMutableArray.
The performance of NSMutableSet degradates very rapidly on increasing of archive size (count of files). Especially it becomes when costly to add new files to it.
2016-07-13 12:59:44 +06:00
Artyom Gladkov
41e2c0f61d Tests validate symlinked files using their file type. 2016-07-13 11:21:18 +06:00
Artyom Gladkov
40d2eb9b1a Set YES to symlinked files during unzipping. 2016-07-13 10:56:30 +06:00
Artyom Gladkov
4203301734 'pod install' for ObjectiveCExample 2016-07-13 10:31:13 +06:00
Joshua Hudson
f420e47ea5 bump podspec and fix swift example and add autolayout constraints. 2016-07-06 15:34:42 -07:00
Joshua Hudson
3050c9a340 Merge pull request #260 from bdunayAGL/master
Nullablilty Annotations for better swift support
2016-07-06 15:23:25 -07:00
Bill Dunay
99d98ac5e8 Added nullablilty annotations to the framework. 2016-07-06 17:44:47 -04:00
Joshua Hudson
d1af8a01ea Merge pull request #261 from sibext/RunOutOfSpaceFix
Check for: Run out of space issue
2016-07-06 12:18:12 -07:00
Joshua Hudson
62e640b3c0 Merge pull request #258 from oanhof/master
check if zip file is password protected
2016-07-06 12:16:43 -07:00
Artyom Gladkov
701400d06f Add errors forwarding on 'run out of space issue' 2016-07-06 18:29:55 +06:00
Dominik Arnhof
d93b03eb1a added password check 2016-07-02 18:52:36 +02:00
Joshua Hudson
4fde7a92dc Add build badge 2016-05-31 13:21:33 -07:00
Joshua Hudson
ca31fc1f8f Now that travis.yml changes are working and being read. Bumped xcode version to 7.3.1 2016-05-31 13:11:07 -07:00
Joshua Hudson
ef241ad443 Now that travis.yml changes are working and being read. Bumped xcode version to 7.3.1 2016-05-31 13:04:51 -07:00
Joshua Hudson
8155c13401 another yml tweak 2016-05-31 12:55:40 -07:00
Joshua Hudson
9dba28d156 another yml tweak 2016-05-31 12:53:28 -07:00
Joshua Hudson
ecb6f4de63 trying to see why travis is not picking up travis yml changes 2016-05-31 12:50:21 -07:00
Joshua Hudson
647e9ed859 Fixed tests no longer working after CocoaPods 1.0 2016-05-31 12:42:22 -07:00
Joshua Hudson
7a0e9ff317 more configuration tweaks 2016-05-31 12:13:20 -07:00
Joshua Hudson
02501b4775 trying to get travic-ci tests to run 2016-05-31 12:02:25 -07:00
Joshua Hudson
4d2962a9e5 made ObjectiveCExample shared scheme 2016-05-31 11:58:42 -07:00
Joshua Hudson
e29a44bac4 Add Travis-CI support. Thanks to @ssoper 2016-05-31 11:51:24 -07:00
Joshua Hudson
0746d77e2d spelling fix 2016-05-31 11:25:15 -07:00
Joshua Hudson
545cc041a9 Don't show test labels until Unzip Sample Data hit 2016-05-31 11:03:26 -07:00
Joshua Hudson
65b9bf19b3 Merge pull request #251 from HongliYu/master
add screens to ObjectiveCExample
2016-05-31 10:58:11 -07:00
HongliYu
dd62e638df Add Objective-C Example 2016-05-29 22:41:56 +08:00
29 changed files with 799 additions and 224 deletions

7
.travis.yml Normal file
View 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

View File

@@ -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;

View File

@@ -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>

View File

@@ -59,6 +59,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {

View File

@@ -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>

View File

@@ -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 Africas elephant herds.

View 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 Assads biggest backers, and in recent weeks has positioned its military in Syria and conducted heavy airstrikes that have allowed Assads 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -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

View File

@@ -1,5 +1,5 @@
#import <Foundation/Foundation.h>
#import <SSZipArchive/SSZipArchive.h>
#import "SSZipArchive.h"
/**
* Test delegate by collecting its calls

View File

@@ -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 {

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/ZipArchive/ZipArchive.svg?branch=master)](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

View File

@@ -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'

View 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
}
}

View File

@@ -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 */

View File

@@ -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;

View File

@@ -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

View File

@@ -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"

View File

@@ -28,7 +28,7 @@
#include "zlib.h"
#include "unzip.h"
#include "Common.h"
#include "SSZipCommon.h"
#ifdef STDC
# include <stddef.h>

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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:.
}

View File

@@ -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"/>

View File

@@ -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
}
}

View File

@@ -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.
}
}

View File

@@ -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;