Skip to content

Instantly share code, notes, and snippets.

@lkraider
Created July 30, 2011 06:02
Show Gist options
  • Save lkraider/1115252 to your computer and use it in GitHub Desktop.
Save lkraider/1115252 to your computer and use it in GitHub Desktop.
MWPhotoBrowser
--- a/MWPhotoBrowser.m
+++ b/MWPhotoBrowser.m
@@ -95,7 +95,6 @@
pagingScrollView.backgroundColor = [UIColor blackColor];
pagingScrollView.contentSize = [self contentSizeForPagingScrollView];
pagingScrollView.contentOffset = [self contentOffsetForPageAtIndex:currentPageIndex];
- [self.view addSubview:pagingScrollView];
// Setup pages
visiblePages = [[NSMutableSet alloc] init];
@@ -143,6 +142,7 @@
[super viewWillAppear:animated];
// Layout
+ [self.view addSubview:pagingScrollView];
[self performLayout];
// Set status bar style to black translucent
@@ -256,7 +256,8 @@
#pragma mark Paging
- (void)tilePages {
-
+ if (!visiblePages) { return; }
+
// Calculate which pages should be visible
// Ignore padding as paging bounces encroach on that
// and lead to false page loads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment