From a9ece3bef78540661cb63f86436f1282f18f1a26 Mon Sep 17 00:00:00 2001 From: David Jennes Date: Thu, 9 Apr 2015 20:07:03 +0200 Subject: [PATCH] Add delegate method with extracted file path --- SSZipArchive/SSZipArchive.h | 1 + SSZipArchive/SSZipArchive.m | 3 +++ 2 files changed, 4 insertions(+) diff --git a/SSZipArchive/SSZipArchive.h b/SSZipArchive/SSZipArchive.h index a13c9ba..0579084 100644 --- a/SSZipArchive/SSZipArchive.h +++ b/SSZipArchive/SSZipArchive.h @@ -59,6 +59,7 @@ - (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; - (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; - (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; +- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath; - (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total; - (void)zipArchiveDidUnzipArchiveFile:(NSString *)zipFile entryPath:(NSString *)entryPath destPath:(NSString *)destPath; diff --git a/SSZipArchive/SSZipArchive.m b/SSZipArchive/SSZipArchive.m index aa9cfa4..aa83f07 100644 --- a/SSZipArchive/SSZipArchive.m +++ b/SSZipArchive/SSZipArchive.m @@ -322,6 +322,9 @@ if ([delegate respondsToSelector:@selector(zipArchiveDidUnzipFileAtIndex:totalFiles:archivePath:fileInfo:)]) { [delegate zipArchiveDidUnzipFileAtIndex:currentFileNumber totalFiles:(NSInteger)globalInfo.number_entry archivePath:path fileInfo:fileInfo]; + } else if ([delegate respondsToSelector: @selector(zipArchiveDidUnzipFileAtIndex:totalFiles:archivePath:unzippedFilePath:)]) { + [delegate zipArchiveDidUnzipFileAtIndex: currentFileNumber totalFiles: (NSInteger)globalInfo.number_entry + archivePath:path unzippedFilePath: fullPath]; } currentFileNumber++;