Skip to content

Commit

Permalink
Preventing _adjustContentOffsetIfNecessary from triggering.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Jun 1, 2016
1 parent 3f4ea68 commit cb99128
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SCStackViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SCStackViewController'
s.version = '3.3.2'
s.version = '3.3.3'
s.platform = :ios
s.ios.deployment_target = '5.0'

Expand Down
12 changes: 9 additions & 3 deletions SCStackViewController/SCStackViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ - (void)setup
self.navigationContaintType = SCStackViewControllerNavigationContraintTypeForward | SCStackViewControllerNavigationContraintTypeReverse;

self.scrollView = [[SCScrollView alloc] init];
[self.scrollView setAutoresizingMask:UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[self.scrollView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[self.scrollView setDirectionalLockEnabled:YES];
[self.scrollView setDecelerationRate:UIScrollViewDecelerationRateFast];
[self.scrollView setDelegate:self];
Expand Down Expand Up @@ -504,15 +504,21 @@ - (void)viewDidLoad
{
[super viewDidLoad];

[self.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[self.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];

[self.rootViewController willMoveToParentViewController:self];
[self.scrollView addSubview:self.rootViewController.view];
[self addChildViewController:self.rootViewController];
[self.rootViewController didMoveToParentViewController:self];

[self.scrollView setFrame:self.view.bounds];
[self.view addSubview:self.scrollView];

// Prevents _adjustContentOffsetIfNecessary from triggering
UIView *scrollViewWrapper = [[UIView alloc] initWithFrame:self.view.bounds];
[scrollViewWrapper setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[scrollViewWrapper addSubview:self.scrollView];

[self.view addSubview:scrollViewWrapper];
}

- (void)viewWillLayoutSubviews
Expand Down

0 comments on commit cb99128

Please sign in to comment.