diff --git a/Classes/Document/CGPDFDocument.m b/Classes/Document/CGPDFDocument.m index 3819350..611c23e 100644 --- a/Classes/Document/CGPDFDocument.m +++ b/Classes/Document/CGPDFDocument.m @@ -59,7 +59,8 @@ CGPDFDocumentRef CGPDFDocumentCreate(NSURL *url, NSString *password) } //Failed to unlock the document. Cleanup. if (CGPDFDocumentIsUnlocked(docRef) == FALSE) { - CGPDFDocumentRelease(docRef), docRef = NULL; + CGPDFDocumentRelease(docRef); + docRef = NULL; } } } else { diff --git a/Classes/View/PDFKBasicPDFViewer.h b/Classes/View/PDFKBasicPDFViewer.h index 51133a8..d45baaf 100644 --- a/Classes/View/PDFKBasicPDFViewer.h +++ b/Classes/View/PDFKBasicPDFViewer.h @@ -48,6 +48,8 @@ typedef void (^PDFKBasicPDFViewerPageChangeBlock)(NSUInteger page); */ - (void)displayPage:(NSUInteger)page; ++ (NSBundle*)getResourcesBundle; + /**@name Properties*/ @property (nonatomic, strong) PDFKBasicPDFViewerPageChangeBlock pageChangeBlock; @@ -55,6 +57,10 @@ typedef void (^PDFKBasicPDFViewerPageChangeBlock)(NSUInteger page); @property (nonatomic, strong, readonly) PDFKDocument *document; /**@name Features*/ +/** + Wether or not to allow showing the thumbs button. + */ +@property (nonatomic, assign) BOOL enableThumbs; /** Wether or not to allow bookmarking of pages. */ @@ -92,10 +98,6 @@ typedef void (^PDFKBasicPDFViewerPageChangeBlock)(NSUInteger page); The slider at the bottom of the screen to show the thumbnails. */ @property (nonatomic, retain, readonly) UIToolbar *thumbnailSlider; -/** - The popover controller to share the document on the iPad. - */ -@property (nonatomic, strong, readonly) UIPopoverController *activityPopoverController; /** The share button. */ diff --git a/Classes/View/PDFKBasicPDFViewer.m b/Classes/View/PDFKBasicPDFViewer.m index 4d59419..9a6107c 100644 --- a/Classes/View/PDFKBasicPDFViewer.m +++ b/Classes/View/PDFKBasicPDFViewer.m @@ -26,7 +26,6 @@ @interface PDFKBasicPDFViewer () @interface PDFKBasicPDFViewerThumbsCollectionView () @@ -228,7 +229,7 @@ - (void)showBookmark:(BOOL)show if (!show) { _bookmarkView.image = nil; } else { - _bookmarkView.image = [[UIImage imageNamed:@"Bookmarked"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + _bookmarkView.image = [[UIImage imageNamed:@"Bookmarked" inBundle:[PDFKBasicPDFViewer getResourcesBundle] compatibleWithTraitCollection:nil] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; } } diff --git a/Classes/View/PDFKPageContent.m b/Classes/View/PDFKPageContent.m index 7de2d02..b22159d 100644 --- a/Classes/View/PDFKPageContent.m +++ b/Classes/View/PDFKPageContent.m @@ -330,7 +330,8 @@ - (id)annotationLinkTarget:(CGPDFDictionaryRef)annotationDictionary //Destination URI string const char *uri = (const char *)CGPDFStringGetBytePtr(uriString); NSString *target = [NSString stringWithCString:uri encoding:NSUTF8StringEncoding]; - linkTarget = [NSURL URLWithString:[target stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; + + linkTarget = [NSURL URLWithString:[target stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]]; //Debug check #if DEBUG if (linkTarget == nil) NSLog(@"%s Bad URI '%@'", __FUNCTION__, target); @@ -543,8 +544,10 @@ - (void)removeFromSuperview - (void)dealloc { - CGPDFPageRelease(_PDFPageRef), _PDFPageRef = NULL; - CGPDFDocumentRelease(_PDFDocRef), _PDFDocRef = NULL; + CGPDFPageRelease(_PDFPageRef); + _PDFPageRef = NULL; + CGPDFDocumentRelease(_PDFDocRef); + _PDFDocRef = NULL; } #pragma mark CATiledLayer delegate methods diff --git a/Classes/View/PDFKPageContentView.m b/Classes/View/PDFKPageContentView.m index dd68740..8edea34 100644 --- a/Classes/View/PDFKPageContentView.m +++ b/Classes/View/PDFKPageContentView.m @@ -279,7 +279,6 @@ - (void)setBounds:(CGRect)bounds //On the third page, the bounds size get set to 0 by autolayout for all pages that are created next. //No idea why... //EXPLAIN!!! EXPLAIN!!! EXPLAIN!!! Explain yourself doctor... -#warning EXPLAIN!!! if (bounds.size.width != 0 && bounds.size.height != 0) { [super setBounds: bounds]; } diff --git a/M13PDFKit.xcodeproj/project.pbxproj b/M13PDFKit.xcodeproj/project.pbxproj index ec31eb6..0de47ee 100644 --- a/M13PDFKit.xcodeproj/project.pbxproj +++ b/M13PDFKit.xcodeproj/project.pbxproj @@ -352,7 +352,7 @@ CAF2562A1A1CFF0000F0EA4F /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastUpgradeCheck = 0810; ORGANIZATIONNAME = BrandonMcQuilkin; TargetAttributes = { CAF256311A1CFF0000F0EA4F = { @@ -517,15 +517,19 @@ 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"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -538,7 +542,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -559,8 +563,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"; @@ -568,13 +574,14 @@ ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -590,8 +597,8 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_RESOURCE_RULES_PATH = "$(SDKROOT)/ResourceRules.plist"; INFOPLIST_FILE = M13PDFKit/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -604,8 +611,8 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_RESOURCE_RULES_PATH = "$(SDKROOT)/ResourceRules.plist"; INFOPLIST_FILE = M13PDFKit/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -624,6 +631,7 @@ ); INFOPLIST_FILE = M13PDFKitTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/M13PDFKit.app/M13PDFKit"; }; @@ -639,6 +647,7 @@ ); INFOPLIST_FILE = M13PDFKitTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/M13PDFKit.app/M13PDFKit"; }; diff --git a/M13PDFKit.xcodeproj/xcshareddata/xcschemes/M13PDFKit.xcscheme b/M13PDFKit.xcodeproj/xcshareddata/xcschemes/M13PDFKit.xcscheme index 4661461..4712c89 100644 --- a/M13PDFKit.xcodeproj/xcshareddata/xcschemes/M13PDFKit.xcscheme +++ b/M13PDFKit.xcodeproj/xcshareddata/xcschemes/M13PDFKit.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -62,15 +62,18 @@ ReferencedContainer = "container:M13PDFKit.xcodeproj"> + + @@ -86,10 +89,10 @@ diff --git a/M13PDFKit/Images.xcassets/AppIcon.appiconset/Contents.json b/M13PDFKit/Images.xcassets/AppIcon.appiconset/Contents.json index 8ce3f36..377da0f 100644 --- a/M13PDFKit/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/M13PDFKit/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "size" : "29x29", "idiom" : "iphone", @@ -36,6 +46,16 @@ "filename" : "Icon-60@3x.png", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "size" : "29x29", "idiom" : "ipad", @@ -71,6 +91,11 @@ "idiom" : "ipad", "filename" : "Icon-76@2x.png", "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" } ], "info" : { diff --git a/M13PDFKit/Info.plist b/M13PDFKit/Info.plist index 08c7f50..fa00b2c 100644 --- a/M13PDFKit/Info.plist +++ b/M13PDFKit/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/M13PDFKitTests/Info.plist b/M13PDFKitTests/Info.plist index bf86bd5..ba72822 100644 --- a/M13PDFKitTests/Info.plist +++ b/M13PDFKitTests/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName