Fixing page bug when loading app and selecting page that's not the first story.

This commit is contained in:
Samuel Clay 2015-04-26 21:22:25 -07:00
parent cf75462daf
commit 51e25cf051
7 changed files with 13 additions and 7 deletions

View file

@ -1473,6 +1473,7 @@
if (activeStoryLocation >= 0) {
BOOL animated = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad &&
!self.tryFeedCategory);
[self.storyPageControl view];
[self.storyPageControl changePage:activeStoryLocation animated:animated];
[self.storyPageControl animateIntoPlace:YES];
}

View file

@ -249,7 +249,7 @@
- (NSString *)activeStoryView {
NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];
NSString *storyViewPref = [userPreferences stringForKey:[self storyViewKey]];
NSLog(@"Story pref: %@ (%d)", storyViewPref, self.isRiverView);
// NSLog(@"Story pref: %@ (%d)", storyViewPref, self.isRiverView);
if (storyViewPref) {
return storyViewPref;
} else {

View file

@ -57,6 +57,11 @@
}
- (NSString *)description {
NSString *page = appDelegate.storyPageControl.currentPage == self ? @"currentPage" : appDelegate.storyPageControl.previousPage == self ? @"previousPage" : appDelegate.storyPageControl.nextPage == self ? @"nextPage" : @"unattached page";
return [NSString stringWithFormat:@"%@", page];
}
- (void)viewDidLoad {
[super viewDidLoad];

View file

@ -547,7 +547,7 @@
NSInteger wasIndex = pageController.pageIndex;
pageController.pageIndex = newIndex;
NSLog(@"Applied Index: Was %ld, now %ld (%ld/%ld/%ld) [%lu stories - %d] %@", (long)wasIndex, (long)newIndex, (long)previousPage.pageIndex, (long)currentPage.pageIndex, (long)nextPage.pageIndex, (unsigned long)[appDelegate.storiesCollection.activeFeedStoryLocations count], outOfBounds, NSStringFromCGRect(self.scrollView.frame));
// NSLog(@"Applied Index to %@: Was %ld, now %ld (%ld/%ld/%ld) [%lu stories - %d] %@", pageController, (long)wasIndex, (long)newIndex, (long)previousPage.pageIndex, (long)currentPage.pageIndex, (long)nextPage.pageIndex, (unsigned long)[appDelegate.storiesCollection.activeFeedStoryLocations count], outOfBounds, NSStringFromCGRect(self.scrollView.frame));
if (newIndex > 0 && newIndex >= [appDelegate.storiesCollection.activeFeedStoryLocations count]) {
pageController.pageIndex = -2;

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14D87h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7531" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="StoryPageControl">

View file

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.6.4</string>
<string>4.7.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -58,7 +58,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>48</string>
<string>49</string>
<key>FacebookAppID</key>
<string>230426707030569</string>
<key>LSRequiresIPhoneOS</key>

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