Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to decide the targetContentOffsetCenter #9

Open
stuffmc opened this issue Jul 2, 2013 · 1 comment
Open

Ability to decide the targetContentOffsetCenter #9

stuffmc opened this issue Jul 2, 2013 · 1 comment

Comments

@stuffmc
Copy link
Contributor

stuffmc commented Jul 2, 2013

In locateClosestPageOnPrevious:onCurrent:onNext: there's this code

    contentOffset.x + 0.5f * CGRectGetWidth(self.scrollView.frame),
    contentOffset.y + 0.5f * CGRectGetHeight(self.scrollView.frame),

which will call layoutSubview if it you're doing anything "expensive" on the MainThread it will then block while swiping. Although I agree we shouldn't have anything expensive, in the real world, for various reasons, you might have something taking .2 seconds on a device in viewDidLoad.

I figures out having 1.0f instead of 0.5f would then have this "blocking" happening only when reaching the edge — instead of in the middle.

It would be nice if we could either specify this 0.5f (or 1.0f) as a property instead of it being hard coded.

@stuffmc
Copy link
Contributor Author

stuffmc commented Jul 3, 2013

As a side note 1.0f has a bit of a weird side-effect where I can't push anything anymore to the navigationController being in the ScrollView... But 0.9f for example works fine. I might try a higher value (e.g. 0.95f) but there's very little chance people "swipe" that far to the right/left so even 0.9f should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant