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

provide bounce effect for constraints #86

Open
incanus opened this issue Jul 21, 2012 · 2 comments
Open

provide bounce effect for constraints #86

incanus opened this issue Jul 21, 2012 · 2 comments

Comments

@incanus
Copy link

incanus commented Jul 21, 2012

Per an idea over here, it would be cool if when NE/SW constraints were applied to the map view, the UIScrollView bounce behavior could be emulated, even though we're not really hitting the edge of the contentView but are using false constraints on the scroll view.

I'm thinking maybe this could be accomplished with a second, invisible/offscreen scroll view with its pan gesture recognizer attached to the map view's scroll view, so that the fake's contentView truly hits its edges when the map view's hits its false constraints. Then, the fake's bounce behavior could be tracked and applied to the main's. Not sure if that makes sense, but hopefully it does :-)

I'll try to take a crack at this if you like.

@trasch
Copy link

trasch commented Aug 1, 2012

I don't need this (yet), so you will have to tackle this yourself, I guess... :)

Maybe you could implement it as well in RMMapScrollView or in scrollView:correctedContentOffset:, but I haven't really thought about it. Using a second offscreen scroll view seems to be quite complex, do you think it's worth the effort?

@incanus
Copy link
Author

incanus commented Aug 1, 2012

Well, I'm thinking it's not too crazy complex. Think of how overlays work -- even with deceleration, it sticks to the scrollview just fine. So we have a hidden scrollview which the map view observers and mirrors its contentOffset from, working in a similar way. I think the end effect will be really nice -- not having to care about constraints. And I think if it works, it could be applied to the way we currently limit even without bounce animations.

Anyway, yeah, I'll take a look sometime soon.

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

2 participants