Permalink
Browse files

Merge branch 'add_zip_demo' into develop

  • Loading branch information...
2 parents 7d54db0 + 2068b61 commit a3bcb1842891a3245531d374a311bd152834f337 @gugmaster gugmaster committed Aug 5, 2013
View
229 DTFoundation.xcodeproj/project.pbxproj
@@ -316,7 +316,6 @@
FA9CB81A17ABDF1500A596C5 /* DTASN1Serialization.m in Sources */ = {isa = PBXBuildFile; fileRef = A78EDD2317A65AD800480205 /* DTASN1Serialization.m */; };
FA9CB81D17ABDF6400A596C5 /* libDTASN1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA9CB80C17ABDEF200A596C5 /* libDTASN1.a */; };
FAA6841C16AD4E350092FD00 /* libDTZipArchive_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A7E383DA160DFF8600CF72D6 /* libDTZipArchive_iOS.a */; };
- FAA6842116AD50760092FD00 /* libz.1.1.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FAA6842016AD50760092FD00 /* libz.1.1.3.dylib */; };
FAAC041416B1421F00EB1C7F /* screenshot.png in Resources */ = {isa = PBXBuildFile; fileRef = FAAC041316B1421F00EB1C7F /* screenshot.png */; };
FAB17249162FFA6800B44EDC /* NSArrayDTErrorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB17248162FFA6800B44EDC /* NSArrayDTErrorTest.m */; };
FAB1724C162FFC5200B44EDC /* DictionarySample.plist in Resources */ = {isa = PBXBuildFile; fileRef = FAB1724B162FFC5200B44EDC /* DictionarySample.plist */; };
@@ -333,6 +332,26 @@
FAB172AC163024E200B44EDC /* ArraySample.plist in Resources */ = {isa = PBXBuildFile; fileRef = FAB172AB163024E200B44EDC /* ArraySample.plist */; };
FAB172AF163027C700B44EDC /* NSDictionaryDTErrorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB172AE163027C700B44EDC /* NSDictionaryDTErrorTest.m */; };
FAB172B816302FC700B44EDC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7F4DFF8147FD08900F4059A /* UIKit.framework */; };
+ FAF37A2117AFDD93009AC27C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7F4DFF8147FD08900F4059A /* UIKit.framework */; };
+ FAF37A2217AFDD93009AC27C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7F4DFFA147FD08F00F4059A /* Foundation.framework */; };
+ FAF37A2317AFDD93009AC27C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE5B9311610A38200CA0D99 /* CoreGraphics.framework */; };
+ FAF37A5317AFDF0B009AC27C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FAF37A4D17AFDF0B009AC27C /* AppDelegate.m */; };
+ FAF37A5417AFDF0B009AC27C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FAF37A4E17AFDF0B009AC27C /* main.m */; };
+ FAF37A5517AFDF0B009AC27C /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FAF37A5017AFDF0B009AC27C /* Default-568h@2x.png */; };
+ FAF37A5617AFDF0B009AC27C /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FAF37A5117AFDF0B009AC27C /* Default.png */; };
+ FAF37A5717AFDF0B009AC27C /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FAF37A5217AFDF0B009AC27C /* Default@2x.png */; };
+ FAF37A5A17AFDF63009AC27C /* libDTZipArchive_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A7E383DA160DFF8600CF72D6 /* libDTZipArchive_iOS.a */; };
+ FAF37A6517AFE004009AC27C /* ZipNodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAF37A5B17AFE004009AC27C /* ZipNodeViewController.m */; };
+ FAF37A6617AFE004009AC27C /* ZipArchiveModel.m in Sources */ = {isa = PBXBuildFile; fileRef = FAF37A5D17AFE004009AC27C /* ZipArchiveModel.m */; };
+ FAF37A6717AFE004009AC27C /* ZipArchiveManager.m in Sources */ = {isa = PBXBuildFile; fileRef = FAF37A5F17AFE004009AC27C /* ZipArchiveManager.m */; };
+ FAF37A6817AFE004009AC27C /* ZipArchiveCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FAF37A6117AFE004009AC27C /* ZipArchiveCell.m */; };
+ FAF37A6917AFE004009AC27C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FAF37A6317AFE004009AC27C /* ViewController.m */; };
+ FAF37A6B17AFE01E009AC27C /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FAF37A6A17AFE01E009AC27C /* Storyboard.storyboard */; };
+ FAF37A6D17AFE06B009AC27C /* libz.1.2.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FAF37A6C17AFE06B009AC27C /* libz.1.2.5.dylib */; };
+ FAF37A6E17AFE07F009AC27C /* libz.1.2.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FAF37A6C17AFE06B009AC27C /* libz.1.2.5.dylib */; };
+ FAF37A7017AFE098009AC27C /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAF37A6F17AFE098009AC27C /* QuickLook.framework */; };
+ FAF37A7317AFE0D1009AC27C /* libDTFoundation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A70B4CE71486637E00873A4A /* libDTFoundation.a */; };
+ FAF37A7417AFE11D009AC27C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAB1725D163004FF00B44EDC /* QuartzCore.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -378,6 +397,20 @@
remoteGlobalIDString = A70B4CE61486637E00873A4A;
remoteInfo = "Static Library";
};
+ FAF37A5817AFDF5D009AC27C /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = A7F4DF9A147FB61500F4059A /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = A7E383D9160DFF8600CF72D6;
+ remoteInfo = "DTZipArchive (iOS)";
+ };
+ FAF37A7117AFE0CC009AC27C /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = A7F4DF9A147FB61500F4059A /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = A70B4CE61486637E00873A4A;
+ remoteInfo = "Static Library";
+ };
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -692,7 +725,6 @@
C0494E7390203BE4105C5070 /* DTZipArchivePKZip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTZipArchivePKZip.h; sourceTree = "<group>"; };
C0494FCC2C675F2CDF315027 /* DTZipArchiveNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTZipArchiveNode.m; sourceTree = "<group>"; };
FA9CB80C17ABDEF200A596C5 /* libDTASN1.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDTASN1.a; sourceTree = BUILT_PRODUCTS_DIR; };
- FAA6842016AD50760092FD00 /* libz.1.1.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.1.3.dylib; path = usr/lib/libz.1.1.3.dylib; sourceTree = SDKROOT; };
FAAC041316B1421F00EB1C7F /* screenshot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = screenshot.png; path = Test/Resources/screenshot.png; sourceTree = SOURCE_ROOT; };
FAB17247162FFA6800B44EDC /* NSArrayDTErrorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArrayDTErrorTest.h; sourceTree = "<group>"; };
FAB17248162FFA6800B44EDC /* NSArrayDTErrorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArrayDTErrorTest.m; sourceTree = "<group>"; };
@@ -704,6 +736,28 @@
FAB172AD163027C700B44EDC /* NSDictionaryDTErrorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDictionaryDTErrorTest.h; sourceTree = "<group>"; };
FAB172AE163027C700B44EDC /* NSDictionaryDTErrorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDictionaryDTErrorTest.m; sourceTree = "<group>"; };
FAE5B9311610A38200CA0D99 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ FAF37A2017AFDD93009AC27C /* DTZipArchive.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DTZipArchive.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ FAF37A3F17AFDE9E009AC27C /* DTZipArchiveDemo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "DTZipArchiveDemo-Info.plist"; sourceTree = "<group>"; };
+ FAF37A4017AFDE9E009AC27C /* DTZipArchiveDemo-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DTZipArchiveDemo-Prefix.pch"; sourceTree = "<group>"; };
+ FAF37A4C17AFDF0B009AC27C /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ FAF37A4D17AFDF0B009AC27C /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ FAF37A4E17AFDF0B009AC27C /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ FAF37A5017AFDF0B009AC27C /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
+ FAF37A5117AFDF0B009AC27C /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
+ FAF37A5217AFDF0B009AC27C /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
+ FAF37A5B17AFE004009AC27C /* ZipNodeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZipNodeViewController.m; sourceTree = "<group>"; };
+ FAF37A5C17AFE004009AC27C /* ZipNodeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipNodeViewController.h; sourceTree = "<group>"; };
+ FAF37A5D17AFE004009AC27C /* ZipArchiveModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZipArchiveModel.m; sourceTree = "<group>"; };
+ FAF37A5E17AFE004009AC27C /* ZIpArchiveModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZIpArchiveModel.h; sourceTree = "<group>"; };
+ FAF37A5F17AFE004009AC27C /* ZipArchiveManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZipArchiveManager.m; sourceTree = "<group>"; };
+ FAF37A6017AFE004009AC27C /* ZipArchiveManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipArchiveManager.h; sourceTree = "<group>"; };
+ FAF37A6117AFE004009AC27C /* ZipArchiveCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZipArchiveCell.m; sourceTree = "<group>"; };
+ FAF37A6217AFE004009AC27C /* ZipArchiveCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipArchiveCell.h; sourceTree = "<group>"; };
+ FAF37A6317AFE004009AC27C /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+ FAF37A6417AFE004009AC27C /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
+ FAF37A6A17AFE01E009AC27C /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Storyboard.storyboard; sourceTree = "<group>"; };
+ FAF37A6C17AFE06B009AC27C /* libz.1.2.5.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.2.5.dylib; path = usr/lib/libz.1.2.5.dylib; sourceTree = SDKROOT; };
+ FAF37A6F17AFE098009AC27C /* QuickLook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickLook.framework; path = System/Library/Frameworks/QuickLook.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -803,7 +857,6 @@
buildActionMask = 2147483647;
files = (
FA9CB81D17ABDF6400A596C5 /* libDTASN1.a in Frameworks */,
- FAA6842116AD50760092FD00 /* libz.1.1.3.dylib in Frameworks */,
FAA6841C16AD4E350092FD00 /* libDTZipArchive_iOS.a in Frameworks */,
A7239FFD16A6CF0B0071E902 /* CoreData.framework in Frameworks */,
A7239FFB16A6CEEF0071E902 /* libDTHTMLParser_iOS.a in Frameworks */,
@@ -815,6 +868,7 @@
FAB1724D162FFF5300B44EDC /* MobileCoreServices.framework in Frameworks */,
A7D60FD115D3B0BC00AEDD1B /* SenTestingKit.framework in Frameworks */,
A7D60FD315D3B0BC00AEDD1B /* Foundation.framework in Frameworks */,
+ FAF37A6E17AFE07F009AC27C /* libz.1.2.5.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -871,6 +925,21 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FAF37A1D17AFDD93009AC27C /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FAF37A7317AFE0D1009AC27C /* libDTFoundation.a in Frameworks */,
+ FAF37A7017AFE098009AC27C /* QuickLook.framework in Frameworks */,
+ FAF37A6D17AFE06B009AC27C /* libz.1.2.5.dylib in Frameworks */,
+ FAF37A5A17AFDF63009AC27C /* libDTZipArchive_iOS.a in Frameworks */,
+ FAF37A2117AFDD93009AC27C /* UIKit.framework in Frameworks */,
+ FAF37A2217AFDD93009AC27C /* Foundation.framework in Frameworks */,
+ FAF37A2317AFDD93009AC27C /* CoreGraphics.framework in Frameworks */,
+ FAF37A7417AFE11D009AC27C /* QuartzCore.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -911,6 +980,7 @@
A70D74BE1743AF5400E6E626 /* Demo */ = {
isa = PBXGroup;
children = (
+ FAF37A3917AFDE9E009AC27C /* DTZipArchiveDemo */,
A7D9D64C1758C8E600C29B6F /* DTReachability */,
A70D74BF1743AF5400E6E626 /* DTSidePanels */,
);
@@ -1181,12 +1251,13 @@
isa = PBXGroup;
children = (
A7D60FF715D3B28B00AEDD1B /* libxml2.dylib */,
- FAA6842016AD50760092FD00 /* libz.1.1.3.dylib */,
+ FAF37A6C17AFE06B009AC27C /* libz.1.2.5.dylib */,
A7239FFC16A6CF0B0071E902 /* CoreData.framework */,
FAE5B9311610A38200CA0D99 /* CoreGraphics.framework */,
A7F4DFFA147FD08F00F4059A /* Foundation.framework */,
A7C619EF162D8D84002C0C1A /* MobileCoreServices.framework */,
FAB1725D163004FF00B44EDC /* QuartzCore.framework */,
+ FAF37A6F17AFE098009AC27C /* QuickLook.framework */,
A7D60FD015D3B0BC00AEDD1B /* SenTestingKit.framework */,
A7D9D6631758CA6300C29B6F /* SystemConfiguration.framework */,
A7F4DFF8147FD08900F4059A /* UIKit.framework */,
@@ -1409,6 +1480,7 @@
A7D9D62D1758C89800C29B6F /* DTReachability Demo.app */,
A79D999C1792D1F50082BC06 /* libDTAWS.a */,
FA9CB80C17ABDEF200A596C5 /* libDTASN1.a */,
+ FAF37A2017AFDD93009AC27C /* DTZipArchive.app */,
);
name = Products;
path = ../..;
@@ -1427,6 +1499,48 @@
path = zipContent;
sourceTree = "<group>";
};
+ FAF37A3917AFDE9E009AC27C /* DTZipArchiveDemo */ = {
+ isa = PBXGroup;
+ children = (
+ FAF37A3F17AFDE9E009AC27C /* DTZipArchiveDemo-Info.plist */,
+ FAF37A4017AFDE9E009AC27C /* DTZipArchiveDemo-Prefix.pch */,
+ FAF37A4B17AFDF0B009AC27C /* Source */,
+ FAF37A4F17AFDF0B009AC27C /* Resources */,
+ );
+ path = DTZipArchiveDemo;
+ sourceTree = "<group>";
+ };
+ FAF37A4B17AFDF0B009AC27C /* Source */ = {
+ isa = PBXGroup;
+ children = (
+ FAF37A5C17AFE004009AC27C /* ZipNodeViewController.h */,
+ FAF37A5B17AFE004009AC27C /* ZipNodeViewController.m */,
+ FAF37A5E17AFE004009AC27C /* ZIpArchiveModel.h */,
+ FAF37A5D17AFE004009AC27C /* ZipArchiveModel.m */,
+ FAF37A6017AFE004009AC27C /* ZipArchiveManager.h */,
+ FAF37A5F17AFE004009AC27C /* ZipArchiveManager.m */,
+ FAF37A6217AFE004009AC27C /* ZipArchiveCell.h */,
+ FAF37A6117AFE004009AC27C /* ZipArchiveCell.m */,
+ FAF37A6417AFE004009AC27C /* ViewController.h */,
+ FAF37A6317AFE004009AC27C /* ViewController.m */,
+ FAF37A4C17AFDF0B009AC27C /* AppDelegate.h */,
+ FAF37A4D17AFDF0B009AC27C /* AppDelegate.m */,
+ FAF37A4E17AFDF0B009AC27C /* main.m */,
+ );
+ path = Source;
+ sourceTree = "<group>";
+ };
+ FAF37A4F17AFDF0B009AC27C /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ FAF37A6A17AFE01E009AC27C /* Storyboard.storyboard */,
+ FAF37A5017AFDF0B009AC27C /* Default-568h@2x.png */,
+ FAF37A5117AFDF0B009AC27C /* Default.png */,
+ FAF37A5217AFDF0B009AC27C /* Default@2x.png */,
+ );
+ path = Resources;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -1886,6 +2000,25 @@
productReference = FA9CB80C17ABDEF200A596C5 /* libDTASN1.a */;
productType = "com.apple.product-type.library.static";
};
+ FAF37A1F17AFDD93009AC27C /* DTZipArchiveDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = FAF37A3817AFDD93009AC27C /* Build configuration list for PBXNativeTarget "DTZipArchiveDemo" */;
+ buildPhases = (
+ FAF37A1C17AFDD93009AC27C /* Sources */,
+ FAF37A1D17AFDD93009AC27C /* Frameworks */,
+ FAF37A1E17AFDD93009AC27C /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ FAF37A7217AFE0CC009AC27C /* PBXTargetDependency */,
+ FAF37A5917AFDF5D009AC27C /* PBXTargetDependency */,
+ );
+ name = DTZipArchiveDemo;
+ productName = DTZipArchiveDemo;
+ productReference = FAF37A2017AFDD93009AC27C /* DTZipArchive.app */;
+ productType = "com.apple.product-type.application";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -1926,6 +2059,7 @@
A7C92B8B174FB9720019D70A /* DTSQLite (Mac) */,
A70D74CF1743AFBC00E6E626 /* DTSidePanels Demo */,
A7D9D62C1758C89800C29B6F /* DTReachability Demo */,
+ FAF37A1F17AFDD93009AC27C /* DTZipArchiveDemo */,
);
};
/* End PBXProject section */
@@ -1984,6 +2118,17 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FAF37A1E17AFDD93009AC27C /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FAF37A5517AFDF0B009AC27C /* Default-568h@2x.png in Resources */,
+ FAF37A5617AFDF0B009AC27C /* Default.png in Resources */,
+ FAF37A5717AFDF0B009AC27C /* Default@2x.png in Resources */,
+ FAF37A6B17AFE01E009AC27C /* Storyboard.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
@@ -2316,6 +2461,20 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FAF37A1C17AFDD93009AC27C /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FAF37A5317AFDF0B009AC27C /* AppDelegate.m in Sources */,
+ FAF37A5417AFDF0B009AC27C /* main.m in Sources */,
+ FAF37A6517AFE004009AC27C /* ZipNodeViewController.m in Sources */,
+ FAF37A6617AFE004009AC27C /* ZipArchiveModel.m in Sources */,
+ FAF37A6717AFE004009AC27C /* ZipArchiveManager.m in Sources */,
+ FAF37A6817AFE004009AC27C /* ZipArchiveCell.m in Sources */,
+ FAF37A6917AFE004009AC27C /* ViewController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
@@ -2349,6 +2508,16 @@
target = A70B4CE61486637E00873A4A /* Static Library */;
targetProxy = FAB17254163003F500B44EDC /* PBXContainerItemProxy */;
};
+ FAF37A5917AFDF5D009AC27C /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = A7E383D9160DFF8600CF72D6 /* DTZipArchive (iOS) */;
+ targetProxy = FAF37A5817AFDF5D009AC27C /* PBXContainerItemProxy */;
+ };
+ FAF37A7217AFE0CC009AC27C /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = A70B4CE61486637E00873A4A /* Static Library */;
+ targetProxy = FAF37A7117AFE0CC009AC27C /* PBXContainerItemProxy */;
+ };
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
@@ -3153,6 +3322,49 @@
};
name = Release;
};
+ FAF37A3617AFDD93009AC27C /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_WARN_EMPTY_BODY = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer: Stefan Gugarel (5V5NEAJJ6M)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Stefan Gugarel (5V5NEAJJ6M)";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "Demo/DTZipArchiveDemo/DTZipArchiveDemo-Prefix.pch";
+ INFOPLIST_FILE = "Demo/DTZipArchiveDemo/DTZipArchiveDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.1;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = DTZipArchive;
+ PROVISIONING_PROFILE = "EE8FE43F-35E0-4192-91C6-0BFF3878BF03";
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "EE8FE43F-35E0-4192-91C6-0BFF3878BF03";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ FAF37A3717AFDD93009AC27C /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_WARN_EMPTY_BODY = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer: Stefan Gugarel (5V5NEAJJ6M)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "Demo/DTZipArchiveDemo/DTZipArchiveDemo-Prefix.pch";
+ INFOPLIST_FILE = "Demo/DTZipArchiveDemo/DTZipArchiveDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.1;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = DTZipArchive;
+ PROVISIONING_PROFILE = "EE8FE43F-35E0-4192-91C6-0BFF3878BF03";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -3334,6 +3546,15 @@
FA9CB81617ABDEF200A596C5 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ FAF37A3817AFDD93009AC27C /* Build configuration list for PBXNativeTarget "DTZipArchiveDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ FAF37A3617AFDD93009AC27C /* Debug */,
+ FAF37A3717AFDD93009AC27C /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
View
55 Demo/DTZipArchiveDemo/DTZipArchiveDemo-Info.plist
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.drobnik.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>org.gnu.gnu-zip-archive</string>
+ <string>com.pkware.zip-archive</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>All Files</string>
+ </dict>
+ </array>
+ <key>UIMainStoryboardFile</key>
+ <string>Storyboard</string>
+ <key>UIFileSharingEnabled</key>
+ <true/>
+</dict>
+</plist>
View
14 Demo/DTZipArchiveDemo/DTZipArchiveDemo-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'DTZipArchiveDemo' target in the 'DTZipArchiveDemo' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
View
BIN Demo/DTZipArchiveDemo/Resources/Default-568h@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Demo/DTZipArchiveDemo/Resources/Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Demo/DTZipArchiveDemo/Resources/Default@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
90 Demo/DTZipArchiveDemo/Resources/Storyboard.storyboard
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="3084" systemVersion="12D78" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="aYK-7U-1Dp">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="2083"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller - Zippo-->
+ <scene sceneID="Y4O-UC-4UY">
+ <objects>
+ <tableViewController id="gha-xf-Zd6" customClass="ViewController" sceneMemberID="viewController">
+ <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="ig4-dH-W6d">
+ <rect key="frame" x="0.0" y="64" width="768" height="960"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ZipArchiveCellIdentifier" editingAccessoryType="disclosureIndicator" id="TNW-vs-0Ju" customClass="ZipArchiveCell">
+ <rect key="frame" x="0.0" y="22" width="768" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+ <rect key="frame" x="0.0" y="0.0" width="748" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </view>
+ </tableViewCell>
+ </prototypes>
+ </tableView>
+ <navigationItem key="navigationItem" title="Zippo" id="Ooa-nB-DmM"/>
+ <connections>
+ <segue destination="D2h-RU-6C4" kind="push" identifier="ShowZipArchiveSegue" id="L79-lw-33b"/>
+ </connections>
+ </tableViewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="Cq8-nb-uCX" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="65" y="-10"/>
+ </scene>
+ <!--Zip Node View Controller - Root View Controller-->
+ <scene sceneID="r6s-Up-r2T">
+ <objects>
+ <tableViewController id="D2h-RU-6C4" customClass="ZipNodeViewController" sceneMemberID="viewController">
+ <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="DTP-Pd-qa4">
+ <rect key="frame" x="0.0" y="64" width="768" height="960"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ZipNodeCellIdentifier" textLabel="bGp-ey-1pX" style="IBUITableViewCellStyleDefault" id="7De-sc-a7Y">
+ <rect key="frame" x="0.0" y="22" width="768" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+ <rect key="frame" x="0.0" y="0.0" width="768" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bGp-ey-1pX">
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </view>
+ </tableViewCell>
+ </prototypes>
+ </tableView>
+ <navigationItem key="navigationItem" title="Root View Controller" id="oot-9k-Wrm"/>
+ </tableViewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="Hf5-tc-2wI" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="1045" y="-4"/>
+ </scene>
+ <!--Navigation Controller-->
+ <scene sceneID="0Fm-YN-Mau">
+ <objects>
+ <navigationController definesPresentationContext="YES" id="aYK-7U-1Dp" sceneMemberID="viewController">
+ <navigationBar key="navigationBar" contentMode="scaleToFill" id="MXK-5E-T4f">
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <connections>
+ <segue destination="gha-xf-Zd6" kind="relationship" relationship="rootViewController" id="ekl-jh-tl3"/>
+ </connections>
+ </navigationController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="27X-Hb-s8Z" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-992" y="-10"/>
+ </scene>
+ </scenes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination"/>
+ </simulatedMetricsContainer>
+</document>
View
15 Demo/DTZipArchiveDemo/Source/AppDelegate.h
@@ -0,0 +1,15 @@
+//
+// AppDelegate.h
+// Zippo
+//
+// Created by Stefan Gugarel on 3/15/13.
+// Copyright (c) 2013 Drobnik KG. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
View
63 Demo/DTZipArchiveDemo/Source/AppDelegate.m
@@ -0,0 +1,63 @@
+//
+// AppDelegate.m
+// Zippo
+//
+// Created by Stefan Gugarel on 3/15/13.
+// Copyright (c) 2013 Drobnik KG. All rights reserved.
+//
+
+#import "AppDelegate.h"
+#import "NSString+DTPaths.h"
+
+@implementation AppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+
+ return YES;
+}
+
+- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
+{
+ if ([url isFileURL])
+ {
+ NSError *error = nil;
+
+ NSString *documentsPath = [[NSString documentsPath] stringByAppendingPathComponent:url.lastPathComponent];
+ NSURL *documentsURL = [NSURL fileURLWithPath:documentsPath];
+ [[NSFileManager defaultManager] moveItemAtURL:url toURL:documentsURL error:&error];
+
+ return YES;
+ }
+
+ return NO;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // 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.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // 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.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // 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.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // 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.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end
View
15 Demo/DTZipArchiveDemo/Source/ViewController.h
@@ -0,0 +1,15 @@
+//
+// ViewController.h
+// AirDrops
+//
+// Created by Stefan Gugarel on 01/11/13.
+// Copyright (c) 2013 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ViewController : UITableViewController {
+
+}
+
+@end
View
153 Demo/DTZipArchiveDemo/Source/ViewController.m
@@ -0,0 +1,153 @@
+//
+// ViewController.m
+// AirDrops
+//
+// Created by Stefan Gugarel on 01/11/13.
+// Copyright (c) 2013 . All rights reserved.
+//
+
+#import <QuickLook/QuickLook.h>
+#import "ViewController.h"
+#import "DTFoundation.h"
+#import "NSString+DTUtilities.h"
+#import "NSString+DTPaths.h"
+#import "ZipArchiveCell.h"
+#import "DTZipArchive.h"
+#import "ZipArchiveManager.h"
+#import "ZipArchiveModel.h"
+#import "DTZipArchiveNode.h"
+#import "ZipNodeViewController.h"
+
+static NSString *cellIdentifier = @"ZipArchiveCellIdentifier";
+
+@interface ViewController () <UIDocumentInteractionControllerDelegate>
+
+@end
+
+@implementation ViewController
+{
+ UIDocumentInteractionController *_documentInteractionController;
+
+ NSURL *_selectedFileURL;
+
+ ZipArchiveManager *_zipArchiveManager;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ // Do any additional setup after loading the view, typically from a nib.
+ NSString *documentsPath = [NSString documentsPath];
+ NSURL *documentsURL = [NSURL fileURLWithPath:documentsPath];
+ _zipArchiveManager = [[ZipArchiveManager alloc] initWithURL:documentsURL];
+
+ for (ZipArchiveModel *zipArchiveModel in _zipArchiveManager.archives)
+ {
+ [self _setupDocumentControllerWithURL:zipArchiveModel.URL];
+ }
+}
+
+- (void)_setupDocumentControllerWithURL:(NSURL *)url
+{
+ if (_documentInteractionController == nil)
+ {
+ _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url];
+ _documentInteractionController.delegate = self;
+ }
+ else
+ {
+ _documentInteractionController.URL = url;
+ }
+}
+
+
+#pragma mark - UITableView Datasource
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+ return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ return [_zipArchiveManager numberOfArchives];
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ ZipArchiveCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
+
+ if (!cell)
+ {
+ cell = [[ZipArchiveCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
+ }
+
+
+ ZipArchiveModel *zipArchive = [_zipArchiveManager archiveAtIndex:indexPath.row];
+
+ cell.textLabel.text = zipArchive.fileName;
+
+ if (zipArchive.unzipped)
+ {
+ cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator;
+ cell.progressView.hidden = NO;
+ }
+ else
+ {
+ cell.editingAccessoryType = UITableViewCellAccessoryNone;
+ cell.progressView.hidden = YES;
+ cell.progressView.progress = zipArchive.progress;
+ }
+
+
+ NSInteger iconCount = [_documentInteractionController.icons count];
+ if (iconCount > 0)
+ {
+ cell.imageView.image = [_documentInteractionController.icons objectAtIndex:iconCount - 1];
+ }
+
+ return cell;
+}
+
+
+#pragma mark - UITableView Delegate
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ [self performSegueWithIdentifier:@"ShowZipArchiveSegue" sender:indexPath];
+}
+
+
+#pragma mark - StoryBoards
+
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
+{
+ if ([[segue identifier] isEqualToString:@"ShowZipArchiveSegue"])
+ {
+ if ([sender isKindOfClass:[NSIndexPath class]])
+ {
+
+ // set application to destination view controller
+ NSIndexPath *indexPath = (NSIndexPath *)sender;
+
+ ZipArchiveModel *zipArchiveModel = [_zipArchiveManager archiveAtIndex:indexPath.row];
+
+
+ DTZipArchive *zipArchive = [DTZipArchive archiveAtPath:zipArchiveModel.path];
+
+ DTZipArchiveNode *rootNode = [[DTZipArchiveNode alloc] init];
+ rootNode.name = zipArchiveModel.fileName;
+ rootNode.directory = YES;
+ [rootNode.children addObjectsFromArray:zipArchive.nodes];
+
+ ZipNodeViewController *zipNodeViewController = (ZipNodeViewController *)[segue destinationViewController];
+
+ zipNodeViewController.node = rootNode;
+ zipNodeViewController.zipArchive = zipArchive;
+
+ }
+ }
+}
+
+@end
View
29 Demo/DTZipArchiveDemo/Source/ZIpArchiveModel.h
@@ -0,0 +1,29 @@
+//
+// ZIpArchiveModel.h
+// Zippo
+//
+// Created by Stefan Gugarel on 3/15/13.
+// Copyright (c) 2013 Drobnik KG. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface ZipArchiveModel : NSObject
+
+- (id)initWithURL:(NSURL *)URL;
+
+@property (nonatomic, readonly) NSString *fileName;
+
+@property (nonatomic, readonly) BOOL unzipped;
+
+@property (nonatomic, readonly) NSURL *URL;
+@property (nonatomic, readonly) NSURL *unzippedFolderURL;
+@property (nonatomic, readonly) NSURL *unzippedURL;
+
+@property (nonatomic, readonly) NSString *path;
+@property (nonatomic, readonly) NSString *unzippedFolderPath;
+@property (nonatomic, readonly) NSString *unzippedPath;
+
+@property (nonatomic, assign) float progress;
+
+@end
View
15 Demo/DTZipArchiveDemo/Source/ZipArchiveCell.h
@@ -0,0 +1,15 @@
+//
+// ZipArchiveCell.h
+// Zippo
+//
+// Created by Stefan Gugarel on 3/15/13.
+// Copyright (c) 2013 Drobnik KG. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ZipArchiveCell : UITableViewCell
+
+@property (weak, nonatomic) IBOutlet UIProgressView *progressView;
+
+@end
View
29 Demo/DTZipArchiveDemo/Source/ZipArchiveCell.m
@@ -0,0 +1,29 @@
+//
+// ZipArchiveCell.m
+// Zippo
+//
+// Created by Stefan Gugarel on 3/15/13.
+// Copyright (c) 2013 Drobnik KG. All rights reserved.
+//
+
+#import "ZipArchiveCell.h"
+
+@implementation ZipArchiveCell
+
+- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
+{
+ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+ if (self) {
+ // Initialization code
+ }
+ return self;
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated
+{
+ [super setSelected:selected animated:animated];
+
+ // Configure the view for the selected state
+}
+
+@end
View
25 Demo/DTZipArchiveDemo/Source/ZipArchiveManager.h
@@ -0,0 +1,25 @@
+//
+// ZipArchiveManager.h
+// Zippo
+//
+// Created by Stefan Gugarel on 3/15/13.
+// Copyright (c) 2013 Drobnik KG. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@class ZipArchiveModel;
+
+@interface ZipArchiveManager : NSObject
+
+- (id)initWithURL:(NSURL *)URL;
+
+- (NSUInteger)numberOfArchives;
+
+- (ZipArchiveModel *)archiveAtIndex:(NSUInteger)index;
+
+@property (nonatomic, readonly) NSURL *URL;
+
+@property (nonatomic, readonly) NSArray *archives;
+
+@end
View
69 Demo/DTZipArchiveDemo/Source/ZipArchiveManager.m
@@ -0,0 +1,69 @@
+//
+// ZipArchiveManager.m
+// Zippo
+//
+// Created by Stefan Gugarel on 3/15/13.
+// Copyright (c) 2013 Drobnik KG. All rights reserved.
+//
+
+#import "ZipArchiveManager.h"
+#import "ZipArchiveModel.h"
+#import "DTZipArchive.h"
+#import "NSString+DTPaths.h"
+
+@implementation ZipArchiveManager
+{
+ NSMutableDictionary *_zipArchivesDictionary;
+}
+
+
+- (id)initWithURL:(NSURL *)URL
+{
+ self = [super init];
+ if (self)
+ {
+ _URL = URL;
+
+ [self _setup];
+ }
+ return self;
+}
+
+- (void)_setup
+{
+ NSMutableArray *temporaryZipArchives = [NSMutableArray array];
+
+ _zipArchivesDictionary = [NSMutableDictionary dictionary];
+
+ NSError *error = nil;
+ NSURL *documentsURL = [NSURL fileURLWithPath:[NSString documentsPath]];
+ NSArray *documentsDirectoryContents =[[NSFileManager defaultManager] contentsOfDirectoryAtURL:documentsURL includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsHiddenFiles error:&error];
+
+ for (NSURL* fileURL in documentsDirectoryContents)
+ {
+ BOOL isDirectory = NO;
+ [[NSFileManager defaultManager] fileExistsAtPath:[fileURL absoluteString] isDirectory:&isDirectory];
+
+ // proceed to add the document URL to our list (only add .zip files)
+ if (!isDirectory && ([[fileURL lastPathComponent] hasSuffix:@".zip"] || [[fileURL lastPathComponent] hasSuffix:@".gz"]))
+ {
+ ZipArchiveModel *zipArchive = [[ZipArchiveModel alloc] initWithURL:fileURL];
+ [temporaryZipArchives addObject:zipArchive];
+ _zipArchivesDictionary[zipArchive.path] = zipArchive;
+ }
+ }
+
+ _archives = [temporaryZipArchives copy];
+}
+
+- (NSUInteger)numberOfArchives
+{
+ return [_archives count];
+}
+
+- (ZipArchiveModel *)archiveAtIndex:(NSUInteger)index
+{
+ return _archives[index];
+}
+
+@end
View
60 Demo/DTZipArchiveDemo/Source/ZipArchiveModel.m
@@ -0,0 +1,60 @@
+//
+// ZIpArchiveModel.m
+// Zippo
+//
+// Created by Stefan Gugarel on 3/15/13.
+// Copyright (c) 2013 Drobnik KG. All rights reserved.
+//
+
+#import "ZipArchiveModel.h"
+
+@implementation ZipArchiveModel
+
+- (id)initWithURL:(NSURL *)URL
+{
+ self = [super init];
+ if (self)
+ {
+
+ NSString *path = [URL absoluteString];
+ NSString *fileName = [path lastPathComponent];
+
+ _fileName = fileName;
+
+ _URL = URL;
+
+ _unzippedURL = [_URL URLByDeletingPathExtension];
+
+ _unzippedFolderURL = [_URL URLByDeletingLastPathComponent];
+ }
+ return self;
+}
+
+- (BOOL)unzipped
+{
+ BOOL isDirectory = NO;
+ if ([[NSFileManager defaultManager] fileExistsAtPath:self.unzippedPath isDirectory:&isDirectory] && isDirectory)
+ {
+ return YES;
+ }
+
+ return NO;
+}
+
+- (NSString *)path
+{
+ return [_URL path];
+}
+
+- (NSString *)unzippedPath
+{
+ return [_unzippedURL path];
+}
+
+- (NSString *)unzippedFolderPath
+{
+ return [_unzippedFolderURL path];
+}
+
+
+@end
View
23 Demo/DTZipArchiveDemo/Source/ZipNodeViewController.h
@@ -0,0 +1,23 @@
+//
+// ZipNodeViewController.m
+// Zippo
+//
+// Created by Stefan Gugarel on 4/12/13.
+// Copyright (c) 2013 Cocoanetics. All rights reserved
+//
+
+
+#import <Foundation/Foundation.h>
+#import "DTZipArchiveNode.h"
+#import "DTZipArchive.h"
+#import <QuickLook/QLPreviewItem.h>
+
+
+
+@interface ZipNodeViewController : UITableViewController
+
+@property (nonatomic, strong) DTZipArchiveNode *node;
+
+@property (nonatomic, strong) DTZipArchive *zipArchive;
+
+@end
View
175 Demo/DTZipArchiveDemo/Source/ZipNodeViewController.m
@@ -0,0 +1,175 @@
+//
+// ZipNodeViewController.m
+// Zippo
+//
+// Created by Stefan Gugarel on 4/12/13.
+// Copyright (c) 2013 Cocoanetics. All rights reserved
+//
+
+
+#import "ZipNodeViewController.h"
+#import <QuickLook/QLPreviewController.h>
+#import "DTFoundation.h"
+#import "NSString+DTUtilities.h"
+
+static NSString *cellIdentifier = @"ZipNodeCellIdentifier";
+
+
+@interface ZipNodeViewController () <QLPreviewControllerDataSource, QLPreviewControllerDelegate, QLPreviewItem>
+
+@end
+
+@implementation ZipNodeViewController
+{
+ UIDocumentInteractionController *_documentInteractionController;
+}
+
+
+#pragma mark - UIView lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.title = _node.name;
+}
+
+
+#pragma mark - UIDocumentInteractionController
+
+- (void)_setupDocumentInteractionControllerForURL:(NSURL *)fileURL
+{
+ if (!_documentInteractionController)
+ {
+ _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
+ }
+
+ _documentInteractionController.URL = fileURL;
+}
+
+
+#pragma mark - UITableView Datasource
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+ return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ DTZipArchiveNode *node = self.node;
+
+ return [node.children count];
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
+
+ if (!cell)
+ {
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
+ }
+
+ DTZipArchiveNode *node = [_node.children objectAtIndex:indexPath.row];
+
+ cell.textLabel.text = [node.name lastPathComponent];
+
+ NSString *filePath = [[NSString cachesPath] stringByAppendingPathComponent:node.name];
+ NSURL *fileURL = [NSURL fileURLWithPath:filePath];
+
+ [self _setupDocumentInteractionControllerForURL:fileURL];
+
+ NSInteger iconCount = [_documentInteractionController.icons count];
+ if (iconCount)
+ {
+ cell.imageView.image = [_documentInteractionController.icons objectAtIndex:iconCount - 1];
+ }
+
+ return cell;
+}
+
+
+#pragma mark - UITableView Delegate
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ DTZipArchiveNode *nodeToShow = _node.children[indexPath.row];
+
+ if (nodeToShow.isDirectory)
+ {
+ ZipNodeViewController *zipNodeViewController = [[ZipNodeViewController alloc] init];
+
+ zipNodeViewController.node = _node.children[indexPath.row];
+ zipNodeViewController.zipArchive = _zipArchive;
+
+ [self.navigationController pushViewController:zipNodeViewController animated:YES];
+ }
+ else
+ {
+ // for case 3 we use the QuickLook APIs directly to preview the document -
+ QLPreviewController *previewController = [[QLPreviewController alloc] init];
+ previewController.dataSource = self;
+ previewController.delegate = self;
+
+ // start previewing the document at the current section index
+ previewController.currentPreviewItemIndex = indexPath.row;
+ [[self navigationController] pushViewController:previewController animated:YES];
+ }
+}
+
+#pragma mark - QLPreviewController DataSource
+
+/**
+ @return The number of items that the preview controller should preview
+ */
+ - (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)previewController
+{
+ return [self.node.children count];
+}
+
+/**
+ @return The item that the preview controller should preview
+ */
+- (id)previewController:(QLPreviewController *)previewController previewItemAtIndex:(NSInteger)idx
+{
+
+ DTZipArchiveNode *node = _node.children[idx];
+
+ // create unique file path for this item
+ NSString *filePath = [[NSString cachesPath] stringByAppendingPathComponent:node.name];
+
+ // check if file was already created before
+ BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:filePath];
+
+ if (!fileExists)
+ {
+ NSError *error = nil;
+ NSData *data = [_zipArchive uncompressZipArchiveNode:node withError:&error];
+
+ if (error)
+ {
+ NSLog(@"Error when uncompressing file: %@", [error localizedDescription]);
+ }
+
+ NSString *directoryPath = [filePath stringByDeletingLastPathComponent];
+ [[NSFileManager defaultManager] createDirectoryAtPath:directoryPath withIntermediateDirectories:YES attributes:nil error:&error];
+
+ if (error)
+ {
+ NSLog(@"Error when creating directory for uncompressed ZIP file: %@", [error localizedDescription]);
+ }
+
+ NSURL *fileURL = [NSURL fileURLWithPath:filePath];
+ [data writeToURL:fileURL atomically:YES];
+
+ if (error)
+ {
+ NSLog(@"Error when writing uncompressed ZIP file: %@", [error localizedDescription]);
+ }
+ }
+
+ return [NSURL fileURLWithPath:filePath];
+}
+
+@end
View
18 Demo/DTZipArchiveDemo/Source/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// Zippo
+//
+// Created by Stefan Gugarel on 3/15/13.
+// Copyright (c) 2013 Drobnik KG. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}

0 comments on commit a3bcb18

Please sign in to comment.