Permalink
Browse files

New version!

  • Loading branch information...
pk committed Jul 31, 2013
1 parent 5344f53 commit 015203c764151f260c57afb833899953d38fe806
Showing with 304 additions and 5,119 deletions.
  1. +1 −0 .ruby-gemset
  2. +1 −0 .ruby-version
  3. +0 −1 Dependencies/Objective-Zip
  4. +0 −1 Dependencies/uidevice-extension
  5. +4 −1 LICENSE.mkd → LICENSE.txt
  6. +21 −0 PKToolbox.podspec
  7. +0 −695 PKToolbox.xcodeproj/project.pbxproj
  8. +0 −8 PKToolbox/PKToolbox-Prefix.pch
  9. +0 −49 PKToolbox/Sources/Foundation/NSDate+PKStandardFormats.h
  10. +0 −81 PKToolbox/Sources/Foundation/NSDate+PKStandardFormats.m
  11. +0 −20 PKToolbox/Sources/Foundation/NSDateFormatter+PKStandardFormats.h
  12. +0 −34 PKToolbox/Sources/Foundation/NSDateFormatter+PKStandardFormats.m
  13. +0 −33 PKToolbox/Sources/Foundation/NSFileManager+PKCopyDirectory.h
  14. +0 −83 PKToolbox/Sources/Foundation/NSFileManager+PKCopyDirectory.m
  15. +0 −16 PKToolbox/Sources/Foundation/NSString+PKMD5.h
  16. +0 −27 PKToolbox/Sources/Foundation/NSString+PKMD5.m
  17. +0 −44 PKToolbox/Sources/Foundation/PKZipUnarchiver.h
  18. +0 −134 PKToolbox/Sources/Foundation/PKZipUnarchiver.m
  19. +0 −17 PKToolbox/Sources/UIKit/PKMultiButtonBarButtonItem.h
  20. +0 −60 PKToolbox/Sources/UIKit/PKMultiButtonBarButtonItem.m
  21. +0 −24 PKToolbox/Sources/UIKit/PKNavigationItem.h
  22. +0 −76 PKToolbox/Sources/UIKit/PKNavigationItem.m
  23. +0 −31 PKToolbox/Sources/UIKit/PKTextFieldTableViewCell.h
  24. +0 −118 PKToolbox/Sources/UIKit/PKTextFieldTableViewCell.m
  25. +0 −40 PKToolbox/Sources/UIKit/PKWebBrowserController.h
  26. +0 −262 PKToolbox/Sources/UIKit/PKWebBrowserController.m
  27. +0 −16 PKToolbox/Sources/UIKit/UIDevice+PKUniqueIdentifier.h
  28. +0 −33 PKToolbox/Sources/UIKit/UIDevice+PKUniqueIdentifier.m
  29. +0 −1 PKToolboxTests/Fixtures/to-copy-original/A/AA.txt
  30. +0 −1 PKToolboxTests/Fixtures/to-copy-original/A/AB.txt
  31. +0 −1 PKToolboxTests/Fixtures/to-copy-original/C/CA.txt
  32. +0 −1 PKToolboxTests/Fixtures/to-copy-result/A/AA.txt
  33. +0 −1 PKToolboxTests/Fixtures/to-copy-result/A/AB.txt
  34. +0 −1 PKToolboxTests/Fixtures/to-copy-result/A/AC.txt
  35. +0 −1 PKToolboxTests/Fixtures/to-copy-result/B/BA.txt
  36. +0 −1 PKToolboxTests/Fixtures/to-copy-result/C/CA.txt
  37. +0 −1 PKToolboxTests/Fixtures/to-copy-updated/A/AA.txt
  38. +0 −1 PKToolboxTests/Fixtures/to-copy-updated/A/AB.txt
  39. +0 −1 PKToolboxTests/Fixtures/to-copy-updated/A/AC.txt
  40. +0 −1 PKToolboxTests/Fixtures/to-copy-updated/B/BA.txt
  41. +0 −22 PKToolboxTests/PKToolboxTests-Info.plist
  42. +0 −12 PKToolboxTests/PKToolboxTests-Prefix.pch
  43. +0 −70 PKToolboxTests/Sources/Foundation/NSString+PKCopyDirectoryTest.m
  44. +0 −30 PKToolboxTests/Sources/Foundation/NSString+PKMD5Test.m
  45. +0 −46 PKToolboxTests/Sources/UIKit/UIDevice+PKUniqueIdentifier.m
  46. +0 −1 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Headers
  47. +0 −1 PKToolboxTests/Vendor/OCHamcrestIOS.framework/OCHamcrestIOS
  48. +0 −1 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Resources
  49. +0 −43 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCAllOf.h
  50. +0 −43 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCAnyOf.h
  51. +0 −40 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCAssertThat.h
  52. +0 −31 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCBaseDescription.h
  53. +0 −25 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCBaseMatcher.h
  54. +0 −88 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCBoxNumber.h
  55. +0 −21 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCCollectMatchers.h
  56. +0 −48 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCDescribedAs.h
  57. +0 −55 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCDescription.h
  58. +0 −61 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCHasCount.h
  59. +0 −42 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCHasDescription.h
  60. +0 −49 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCHasProperty.h
  61. +0 −62 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCInvocationMatcher.h
  62. +0 −52 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIs.h
  63. +0 −61 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsAnything.h
  64. +0 −45 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCloseTo.h
  65. +0 −67 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionContaining.h
  66. +0 −45 ...olboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionContainingInAnyOrder.h
  67. +0 −43 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionContainingInOrder.h
  68. +0 −50 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionOnlyContaining.h
  69. +0 −52 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContaining.h
  70. +0 −51 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContainingEntries.h
  71. +0 −47 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContainingKey.h
  72. +0 −47 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContainingValue.h
  73. +0 −34 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEmptyCollection.h
  74. +0 −42 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqual.h
  75. +0 −47 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqualIgnoringCase.h
  76. +0 −48 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqualIgnoringWhiteSpace.h
  77. +0 −323 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqualToNumber.h
  78. +0 −40 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsIn.h
  79. +0 −43 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsInstanceOf.h
  80. +0 −45 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsNil.h
  81. +0 −45 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsNot.h
  82. +0 −40 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCIsSame.h
  83. +0 −54 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCMatcher.h
  84. +0 −385 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCNumberAssert.h
  85. +0 −113 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCOrderingComparison.h
  86. +0 −17 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCRequireNonNilObject.h
  87. +0 −19 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCRequireNonNilString.h
  88. +0 −30 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCSelfDescribing.h
  89. +0 −43 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCStringContains.h
  90. +0 −48 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCStringContainsInOrder.h
  91. +0 −41 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCStringDescription.h
  92. +0 −43 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCStringEndsWith.h
  93. +0 −43 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCStringStartsWith.h
  94. +0 −18 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCSubstringMatcher.h
  95. +0 −20 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/HCWrapInMatcher.h
  96. +0 −28 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/NSObject+HCSelfDescribingValue.h
  97. +0 −134 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Headers/OCHamcrestIOS.h
  98. BIN PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/OCHamcrestIOS
  99. +0 −42 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/A/Resources/Info.plist
  100. +0 −1 PKToolboxTests/Vendor/OCHamcrestIOS.framework/Versions/Current
  101. +0 −2 PKToolboxTests/en.lproj/InfoPlist.strings
  102. +0 −64 README.mkd
  103. +15 −0 Source/Categories/UIColor+PKAdditions.h
  104. +20 −0 Source/Categories/UIColor+PKAdditions.m
  105. +14 −0 Source/Categories/UIImage+PKAdditions.h
  106. +34 −0 Source/Categories/UIImage+PKAdditions.m
  107. +19 −0 Source/Foundation/PKError.h
  108. +47 −0 Source/Foundation/PKError.m
  109. +22 −0 Source/LICENSE.txt
  110. +17 −0 Source/PKMacros.h
  111. +21 −0 Source/PKToolbox.podspec
  112. +16 −0 Source/Views/PKAlertView.h
  113. +52 −0 Source/Views/PKAlertView.m
View
@@ -0,0 +1 @@
+pktoolbox
View
@@ -0,0 +1 @@
+2.0.0-p0
Submodule Objective-Zip deleted from 077a07
Submodule uidevice-extension deleted from 8f40fe
@@ -1,4 +1,6 @@
-Copyright (C) 2011 by Pavel Kunc, http://pavelkunc.cz
+The MIT License (MIT)
+
+Copyright (c) 2013 Pavel Kunc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -17,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+
View
@@ -0,0 +1,21 @@
+#
+# Be sure to run `pod spec lint PKToolbox.podspec' to ensure this is a
+# valid spec and remove all comments before submitting the spec.
+#
+# To learn more about the attributes see http://docs.cocoapods.org/specification.html
+#
+Pod::Spec.new do |s|
+ s.name = "PKToolbox"
+ s.version = "2.0.0"
+ s.summary = "Pavel's utilities for iOS."
+ s.description = <<-DESC
+ DESC
+ s.homepage = "http://pavelkunc.cz/PKToolbox"
+ s.author = { "Pavel Kunc" => "pavel.kunc@gmail.com" }
+ s.source = { :git => "https://github.com/pk/pktoolbox.git", :tag => "2.0.0" }
+ s.platform = :ios, '6.0'
+ s.source_files = 'Source', 'Source/**/*.{h,m}'
+ s.exclude_files = 'Source/Exclude'
+ s.frameworks = 'Foundation', 'UIKit'
+ s.requires_arc = true
+end

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,8 +0,0 @@
-//
-// Prefix header for all source files of the 'PKToolbox' target in the 'PKToolbox' project
-//
-
-#ifdef __OBJC__
- #import <Foundation/Foundation.h>
- #import <UIKit/UIKit.h>
-#endif
@@ -1,49 +0,0 @@
-//
-// NSDate+PKStandardFormats.h
-// PKToolbox
-//
-// Created by Pavel Kunc on 16/12/2011.
-// Copyright (C) 2011 by Pavel Kunc, http://pavelkunc.cz
-
-@interface NSDate (PKStandardFormats)
-
-/**
- * Convert NSDate into a RFC1123 'Full-Date' string
- * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1).
- */
-- (NSString *)rfc2616String;
-
-- (NSString *)iso8601String;
-
-+ (NSDate *)dateFromISO8601:(NSString *)aDate;
-
-/**
- * Convert a 'Full-Date' string
- * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)
- * into NSDate.
- */
-+ (NSDate *)dateFromRFC2616:(NSString *)aDate;
-
-/**
- * Convert a RFC1123 string
- * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)
- * into NSDate.
- */
-+ (NSDate *)dateFromRFC1123:(NSString *)aDate;
-
-/**
- * Convert a RFC850 string
- * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)
- * into NSDate.
- */
-+ (NSDate *)dateFromRFC850:(NSString *)aDate;
-
-/**
- * Convert a ANSI C string
- * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)
- * into NSDate.
- */
-+ (NSDate *)dateFromANSIC:(NSString *)aDate;
-
-@end
-
@@ -1,81 +0,0 @@
-//
-// NSDate+PKStandardFormats.m
-// PKToolbox
-//
-// Created by Pavel Kunc on 16/12/2011.
-// Copyright (C) 2011 by Pavel Kunc, http://pavelkunc.cz
-
-#import "NSDate+PKStandardFormats.h"
-#import "NSDateFormatter+PKStandardFormats.h"
-
-
-@implementation NSDate (PKStandardFormats)
-
-
-#pragma mark - Date -> String
-
-- (NSString *)iso8601String {
- static NSDateFormatter *df = nil;
- if(df == nil) {
- df = [[NSDateFormatter iso8601DateFormatter] retain];
- }
- return [df stringFromDate:self];
-}
-
-- (NSString *)rfc2616String {
- static NSDateFormatter *df = nil;
- if(df == nil) {
- df = [NSDateFormatter rfc2616DateFormatterWithFormat:(NSString *)rfc1123Format];
- }
- return [df stringFromDate:self];
-}
-
-
-#pragma mark - String -> Date
-
-+ (NSDate *)dateFromISO8601:(NSString *)aDate {
- if(aDate == nil) return nil;
- static NSDateFormatter *df = nil;
- if(df == nil) {
- df = [[NSDateFormatter iso8601DateFormatter] retain];
- }
- return [df dateFromString:aDate];
-}
-
-+ (NSDate *)dateFromRFC2616:(NSString *)aDate {
- NSDate *date = [NSDate dateFromRFC1123:aDate];
- if (date) return date;
- date = [NSDate dateFromRFC850:aDate];
- if (date) return date;
- return [NSDate dateFromANSIC:aDate];
-}
-
-+ (NSDate *)dateFromRFC1123:(NSString *)aDate {
- if(aDate == nil) return nil;
- static NSDateFormatter *df = nil;
- if(df == nil) {
- df = [NSDateFormatter rfc2616DateFormatterWithFormat:(NSString *)rfc1123Format];
- }
- return [df dateFromString:aDate];
-}
-
-+ (NSDate *)dateFromRFC850:(NSString *)aDate {
- if(aDate == nil) return nil;
- static NSDateFormatter *df = nil;
- if(df == nil) {
- df = [NSDateFormatter rfc2616DateFormatterWithFormat:(NSString *)rfc850Format];
- }
- return [df dateFromString:aDate];
-}
-
-+ (NSDate *)dateFromANSIC:(NSString *)aDate {
- if(aDate == nil) return nil;
- static NSDateFormatter *df = nil;
- if(df == nil) {
- df = [NSDateFormatter rfc2616DateFormatterWithFormat:(NSString *)ansicFormat];
- }
- return [df dateFromString:aDate];
-}
-
-@end
-
@@ -1,20 +0,0 @@
-//
-// NSDateFormatter+PKStandardFormats.h
-// PKToolbox
-//
-// Created by Pavel Kunc on 16/12/2011.
-// Copyright (C) 2011 by Pavel Kunc, http://pavelkunc.cz
-
-extern NSString const *rfc1123Format;
-extern NSString const *rfc850Format;
-extern NSString const *ansicFormat;
-extern NSString const *iso8601Format;
-
-
-@interface NSDateFormatter (PKStandardFormats)
-
-+ (NSDateFormatter *)iso8601DateFormatter;
-+ (NSDateFormatter *)rfc2616DateFormatterWithFormat:(NSString *)aFormat;
-
-@end
-
@@ -1,34 +0,0 @@
-//
-// NSDateFormatter+PKStandardFormats.h
-// PKToolbox
-//
-// Created by Pavel Kunc on 16/12/2011.
-// Copyright (C) 2011 by Pavel Kunc, http://pavelkunc.cz
-
-#import "NSDateFormatter+PKStandardFormats.h"
-
-NSString const *rfc1123Format = @"EEE',' dd MMM yyyy HH':'mm':'ss z";
-NSString const *rfc850Format = @"EEEE',' dd'-'MMM'-'yy HH':'mm':'ss z";
-NSString const *ansicFormat = @"EEE MMM d HH':'mm':'ss yyyy";
-NSString const *iso8601Format = @"yyyy-MM-dd'T'HH:mm:ss'Z'";
-
-
-@implementation NSDateFormatter (PKStandardFormats)
-
-+ (NSDateFormatter *)iso8601DateFormatter {
- NSDateFormatter *df = [[[NSDateFormatter alloc] init] autorelease];
- df.timeStyle = NSDateFormatterFullStyle;
- df.dateFormat = (NSString *)iso8601Format;
- return df;
-}
-
-+ (NSDateFormatter *)rfc2616DateFormatterWithFormat:(NSString *)aFormat {
- NSDateFormatter *df = [[[NSDateFormatter alloc] init] autorelease];
- df.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease];
- df.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
- df.dateFormat = aFormat;
- return df;
-}
-
-@end
-
@@ -1,33 +0,0 @@
-//
-// NSFileManager+PKCopyDirectory.h
-// PKToolbox
-//
-// Created by Pavel Kunc on 20/10/2011.
-// Copyright 2011 Pavel Kunc. All rights reserved.
-//
-
-@interface NSFileManager (PKCopyDirectory)
-
-/**
- * Copy directory to dstDirectoryPath with possible overwrite/merge
- *
- * This method copy directory at srcDirectoryPath to dstDirectoryPath and
- * overwrite files whch exists at dstDirectoryPath if overwrite flag is YES.
- *
- * If overwrite is set and FILE (not directory) at the destination exists it is
- * first removed and then copied to the propper location.
- *
- * Resulting directory/file structure is effectively merge between SRC and DST
- * structures with all files updated to the SRC content.
- *
- * @param srcDirectoryPath Path to directory which is to copy
- * @param dstDirectoryPath Destination which MAY exist
- * @returns YES if all went well otherwise NO and sets outError
- */
-- (BOOL)pk_copyDirectoryAtPath:(NSString *)srcDirectoryPath
- toPath:(NSString *)dstDirectoryPath
- overwrite:(BOOL)overwrite
- error:(NSError **)outError;
-
-@end
-
@@ -1,83 +0,0 @@
-//
-// NSFileManager+PKCopyDirectory.m
-// PKToolbox
-//
-// Created by Pavel Kunc on 20/10/2011.
-// Copyright 2011 Pavel Kunc. All rights reserved.
-//
-
-#import "NSFileManager+PKCopyDirectory.h"
-
-@implementation NSFileManager (PKCopyDirectory)
-
-- (BOOL)pk_copyDirectoryAtPath:(NSString *)srcDirectoryPath
- toPath:(NSString *)dstDirectoryPath
- overwrite:(BOOL)overwrite
- error:(NSError **)outError {
- BOOL didCopy = NO;
- BOOL success = YES;
-
- NSFileManager *fm = [[NSFileManager alloc] init];
- // Don't ever use enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:
- // it doesn't work on iOS 4.x! http://openradar.appspot.com/9536091
- NSDirectoryEnumerator *enumerator = [fm enumeratorAtPath:srcDirectoryPath];
-
- // Outer loop is neccessary to release srcFile because enumerator somehow
- // release all after ALL iterations. So we force release using inner pool.
- while(YES) {
- @autoreleasepool {
- NSString *srcFile = [enumerator nextObject];
- if (srcFile == nil) break;
- didCopy = YES;
-
- NSString *srcFilePath = [srcDirectoryPath stringByAppendingPathComponent:srcFile];
- NSString *dstFilePath = [dstDirectoryPath stringByAppendingPathComponent:srcFile];
-
- NSDictionary *srcFileAtributes = [enumerator fileAttributes];
- NSDictionary *dstFileAtributes = [fm attributesOfItemAtPath:dstFilePath
- error:outError];
- BOOL srcFileIsDirectory = ([srcFileAtributes fileType] == NSFileTypeDirectory);
- BOOL dstFileExists = (dstFileAtributes != nil);
-
- ////////////////////////
- // Handle directories //
- ////////////////////////
-
- if (srcFileIsDirectory && dstFileExists) continue;
- if (srcFileIsDirectory && !dstFileExists) {
- if (![fm createDirectoryAtPath:dstFilePath
- withIntermediateDirectories:YES
- attributes:nil
- error:outError]) {
- success = NO;
- break;
- }
- continue;
- }
-
- //////////////////
- // Handle files //
- //////////////////
-
- // Remove file if it exists
- if (dstFileExists) {
- if (![fm removeItemAtPath:dstFilePath error:outError]) {
- success = NO;
- break;
- }
- }
-
- // Copy new file into the destination
- if (![fm copyItemAtPath:srcFilePath toPath:dstFilePath error:outError]) {
- success = NO;
- break;
- }
- } // autoreleasepool
- } // while
- [fm release];
-
- return didCopy && success;
-}
-
-@end
-
@@ -1,16 +0,0 @@
-//
-// NSString+PKMD5.h
-// PKToolbox
-//
-// Created by Pavel Kunc on 27/10/2011.
-// Copyright 2011 Pavel Kunc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import <CommonCrypto/CommonDigest.h>
-
-@interface NSString (PKMD5)
-
-- (NSString *)pk_MD5Hash;
-
-@end
Oops, something went wrong.

0 comments on commit 015203c

Please sign in to comment.