Cleaning up unused rotation code.

This commit is contained in:
Samuel Clay 2015-09-22 13:30:21 -07:00
parent dc9024c03d
commit c5de98447f
3 changed files with 1 additions and 42 deletions

View file

@ -233,22 +233,6 @@
}];
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
preRotateSize = webView.scrollView.contentSize;
NSLog(@"Height is %@ (Offset is %@)", @(preRotateSize.height), @(webView.scrollView.contentOffset.y));
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[self drawFeedGradient];
CGSize newSize = webView.scrollView.contentSize;
CGPoint newOffset = webView.scrollView.contentOffset;
CGFloat preOffset = newOffset.y;
newOffset.y *= newSize.height / preRotateSize.height;
NSLog(@"Height was %@, now %@ (Offset was %@, now %@)", @(preRotateSize.height), @(newSize.height), @(preOffset), @(newOffset.y));
// webView.scrollView.contentOffset = newOffset;
}
#pragma mark -
#pragma mark Story setup

View file

@ -331,31 +331,6 @@
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
// CGPoint scrollPosition = CGPointMake(0, scrollPct * currentPage.webView.scrollView.contentSize.height);
// NSLog(@"Scrolling to %2.2f%% of %.0f", scrollPct*100, currentPage.webView.scrollView.contentSize.height);
//
// [currentPage.webView.scrollView setContentOffset:scrollPosition animated:YES];
inRotation = NO;
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration {
inRotation = YES;
if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
NSLog(@"Rotating to portrait: %.0f,%.0f",self.view.frame.size.width,self.view.frame.size.height);
} else if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)){
NSLog(@"Rotating to landscape: %.0f,%.0f",self.view.frame.size.width,self.view.frame.size.height);
}
[self layoutForInterfaceOrientation:toInterfaceOrientation];
[self adjustDragBar:toInterfaceOrientation];
// [self reorientPages:toInterfaceOrientation];
}
- (void)layoutForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad &&
// appDelegate.masterContainerViewController.originalViewIsVisible) {

View file

@ -5,7 +5,7 @@
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#define DEBUG 1
//#define DEBUG 1
//#define PROD_DEBUG 1
#ifdef DEBUG