diff --git a/Classes/View/PDFKPageContentView.h b/Classes/View/PDFKPageContentView.h index 13d2b94..f90706b 100644 --- a/Classes/View/PDFKPageContentView.h +++ b/Classes/View/PDFKPageContentView.h @@ -25,7 +25,6 @@ #import #import "PDFKThumbView.h" -#import "DebugScrollView.h" @class PDFKPageContentView; @class PDFKPageContent; @@ -49,7 +48,7 @@ /** The container view for the PDFKPageContent (view) that allows zooming in on the page. */ -@interface PDFKPageContentView : DebugScrollView +@interface PDFKPageContentView : UIScrollView /** The PDFKPageContentView's delegate that will receive touch event information. diff --git a/Classes/View/PDFKPageContentView.m b/Classes/View/PDFKPageContentView.m index 20b5c72..111cc9c 100644 --- a/Classes/View/PDFKPageContentView.m +++ b/Classes/View/PDFKPageContentView.m @@ -94,6 +94,10 @@ - (id)initWithFrame:(CGRect)frame fileURL:(NSURL *)fileURL page:(NSUInteger)page theContainerView.autoresizingMask = UIViewAutoresizingNone; theContainerView.backgroundColor = [UIColor whiteColor]; + //Remove autoresizing constraints. + theContentView.translatesAutoresizingMaskIntoConstraints = NO; + theThumbView.translatesAutoresizingMaskIntoConstraints = NO; + //Content size same as view size self.contentSize = theContentView.bounds.size; @@ -244,16 +248,6 @@ - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView return theContainerView; } -- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView -{ - NSLog(@"-------- BEGIN PAN -----------"); -} - -- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate -{ - NSLog(@"-------- END PAN -----------"); -} - #pragma mark UIResponder instance methods - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event @@ -284,7 +278,7 @@ - (void)setBounds:(CGRect)bounds //No idea why... //EXPLAIN!!! EXPLAIN!!! EXPLAIN!!! Explain yourself doctor... #warning EXPLAIN!!! - if (bounds.size.width != 0 && bounds.size.height == 0) { + 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 47f22b3..ad44b4c 100644 --- a/M13PDFKit.xcodeproj/project.pbxproj +++ b/M13PDFKit.xcodeproj/project.pbxproj @@ -8,13 +8,11 @@ /* Begin PBXBuildFile section */ 186C7FBB404D4DA5AD113882 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 88CCBC2FFD064D688D11FAD6 /* libPods.a */; }; - CA784D9F1A1F982F003F953B /* Physics and Chemistry of Color.pdf in Resources */ = {isa = PBXBuildFile; fileRef = CA784D9E1A1F982F003F953B /* Physics and Chemistry of Color.pdf */; }; CA784DA21A1F99A6003F953B /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA784DA11A1F99A6003F953B /* ImageIO.framework */; }; CA86CE8C1A1EAF45009CDD7C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA86CE8B1A1EAF45009CDD7C /* CoreGraphics.framework */; }; CA86CE901A1EAF56009CDD7C /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA86CE8F1A1EAF56009CDD7C /* MessageUI.framework */; }; CA86CE931A1EB311009CDD7C /* SamplesTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA86CE921A1EB311009CDD7C /* SamplesTableViewController.m */; }; CA86CE971A1EB561009CDD7C /* Wikipedia.pdf in Resources */ = {isa = PBXBuildFile; fileRef = CA86CE961A1EB561009CDD7C /* Wikipedia.pdf */; }; - CA86CE9A1A1EB56C009CDD7C /* DebugScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA86CE991A1EB56C009CDD7C /* DebugScrollView.m */; }; CAF256381A1CFF0000F0EA4F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CAF256371A1CFF0000F0EA4F /* main.m */; }; CAF2563B1A1CFF0000F0EA4F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CAF2563A1A1CFF0000F0EA4F /* AppDelegate.m */; }; CAF256411A1CFF0000F0EA4F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CAF2563F1A1CFF0000F0EA4F /* Main.storyboard */; }; @@ -51,15 +49,12 @@ 3BC96A8F8D1C3AA80967EB3F /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 88CCBC2FFD064D688D11FAD6 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 9B73E826AFCCB1D55EC99EF8 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - CA784D9E1A1F982F003F953B /* Physics and Chemistry of Color.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = "Physics and Chemistry of Color.pdf"; path = "../../../../../Physics Textbooks/Physics and Chemistry of Color.pdf"; sourceTree = ""; }; CA784DA11A1F99A6003F953B /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; CA86CE8B1A1EAF45009CDD7C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; CA86CE8F1A1EAF56009CDD7C /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; CA86CE911A1EB311009CDD7C /* SamplesTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SamplesTableViewController.h; sourceTree = ""; }; CA86CE921A1EB311009CDD7C /* SamplesTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SamplesTableViewController.m; sourceTree = ""; }; CA86CE961A1EB561009CDD7C /* Wikipedia.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Wikipedia.pdf; sourceTree = ""; }; - CA86CE981A1EB56C009CDD7C /* DebugScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugScrollView.h; sourceTree = ""; }; - CA86CE991A1EB56C009CDD7C /* DebugScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugScrollView.m; sourceTree = ""; }; CAF256321A1CFF0000F0EA4F /* M13PDFKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = M13PDFKit.app; sourceTree = BUILT_PRODUCTS_DIR; }; CAF256361A1CFF0000F0EA4F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; CAF256371A1CFF0000F0EA4F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; @@ -167,14 +162,11 @@ CAF256341A1CFF0000F0EA4F /* M13PDFKit */ = { isa = PBXGroup; children = ( - CA86CE981A1EB56C009CDD7C /* DebugScrollView.h */, - CA86CE991A1EB56C009CDD7C /* DebugScrollView.m */, CAF2565B1A1CFF2C00F0EA4F /* Classes */, CAF256391A1CFF0000F0EA4F /* AppDelegate.h */, CAF2563A1A1CFF0000F0EA4F /* AppDelegate.m */, CA86CE911A1EB311009CDD7C /* SamplesTableViewController.h */, CA86CE921A1EB311009CDD7C /* SamplesTableViewController.m */, - CA784D9E1A1F982F003F953B /* Physics and Chemistry of Color.pdf */, CA86CE961A1EB561009CDD7C /* Wikipedia.pdf */, CAF2563F1A1CFF0000F0EA4F /* Main.storyboard */, CAF256421A1CFF0100F0EA4F /* Images.xcassets */, @@ -352,7 +344,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - CA784D9F1A1F982F003F953B /* Physics and Chemistry of Color.pdf in Resources */, CA86CE971A1EB561009CDD7C /* Wikipedia.pdf in Resources */, CAF256411A1CFF0000F0EA4F /* Main.storyboard in Resources */, CAF256431A1CFF0100F0EA4F /* Images.xcassets in Resources */, @@ -414,7 +405,6 @@ CAF256891A1CFF2C00F0EA4F /* PDFKPageContent.m in Sources */, CAF2563B1A1CFF0000F0EA4F /* AppDelegate.m in Sources */, CAF256871A1CFF2C00F0EA4F /* PDFKBasicPDFViewerSinglePageCollectionView.m in Sources */, - CA86CE9A1A1EB56C009CDD7C /* DebugScrollView.m in Sources */, CAF256861A1CFF2C00F0EA4F /* PDFKBasicPDFViewer.m in Sources */, CAF256821A1CFF2C00F0EA4F /* PDFKThumbQueue.m in Sources */, CAF256831A1CFF2C00F0EA4F /* PDFKThumbRenderer.m in Sources */, diff --git a/M13PDFKit.xcworkspace/xcuserdata/Brandon.xcuserdatad/UserInterfaceState.xcuserstate b/M13PDFKit.xcworkspace/xcuserdata/Brandon.xcuserdatad/UserInterfaceState.xcuserstate index 47a72b8..c6a65bd 100644 Binary files a/M13PDFKit.xcworkspace/xcuserdata/Brandon.xcuserdatad/UserInterfaceState.xcuserstate and b/M13PDFKit.xcworkspace/xcuserdata/Brandon.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/M13PDFKit/DebugScrollView.h b/M13PDFKit/DebugScrollView.h deleted file mode 100644 index 528fdff..0000000 --- a/M13PDFKit/DebugScrollView.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// DebugScrollView.h -// M13PDFKit -// -// Created by Brandon McQuilkin on 5/14/14. -// Copyright (c) 2014 Brandon McQuilkin. All rights reserved. -// - -#import - -@interface DebugScrollView : UIScrollView - -@end diff --git a/M13PDFKit/DebugScrollView.m b/M13PDFKit/DebugScrollView.m deleted file mode 100644 index d28954d..0000000 --- a/M13PDFKit/DebugScrollView.m +++ /dev/null @@ -1,42 +0,0 @@ -// -// DebugScrollView.m -// M13PDFKit -// -// Created by Brandon McQuilkin on 5/14/14. -// Copyright (c) 2014 Brandon McQuilkin. All rights reserved. -// - -#import "DebugScrollView.h" - -@implementation DebugScrollView - -- (void)setContentOffset:(CGPoint)contentOffset -{ - NSLog(@"Set Content Override: %@", NSStringFromCGPoint(contentOffset)); - - if (contentOffset.x == 0 && contentOffset.y == 0) { - NSLog(@"Break"); - } - - [super setContentOffset:contentOffset]; -} - -- (void)setFrame:(CGRect)frame -{ - NSLog(@"Set Frame Override: %@", NSStringFromCGRect(frame)); - [super setFrame:frame]; -} - -- (void)setBounds:(CGRect)bounds -{ - NSLog(@"Set Bounds Override: %@", NSStringFromCGRect(bounds)); - [super setBounds:bounds]; -} - -- (void)setContentSize:(CGSize)contentSize -{ - NSLog(@"Set Content Size Override: %@", NSStringFromCGSize(contentSize)); - [super setContentSize:contentSize]; -} - -@end