-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add support for views on top / bottom and rotation about the x-axis #6
Comments
I'll consider it for now. The problem with this is that you then can't use UIScrollViews/UITableViews as they take over the swipe up/down gesture. You're also right in that the it only works if there are 4 sides, making it a cube. The |
Agreed. But, @jamiebullock, hopefully if you look at the code you could see how you could do this yourself. The basic trick for doing these sorts of cube transformations is to do a negative z transform to the point of rotation (in the case of a cube, it's half the width of a side), rotate 90 degrees (M_PI_2 radians) about the appropriate axis, and then do a matching positive z transform (so the edges match up again ... which, by the way, is why, when you tried adjusting one of the transforms in your earlier question, the edges no longer matched up). When you tackle this, there are going to be a few challenges, though:
Bottom line, while none of this is rocket-science, there's a lot of work in this seemingly simple request. I'd suggest you take a crack at this yourself and share your progress with us. But hopefully the techniques employed in this class (the custom container view controller with the appropriate containment calls, the use of multiple |
Thanks guys, this is really helpful. I don't need an arbitrarily rotatable cube for my purposes, but rather that the cube simply exposes its top or bottom view by about 30 degrees when pulled up or down from a bounded area in the main view and to flick back when the finger is removed from the screen. I just wanted to phrase the request in such a way that it might be of more general interest. I definitely have enough info to implement this myself, so I'll work on it and report back if I have something that might be reused. Thanks again for @pyro2927 for making this class available in the first place, and and @robertmryan for all the extra advice and input. |
It would be great if this control optionally supported adding of views to the top bottom of the cube. So that if I have a view on the top of the cube and I drag downwards, the cube rotates about its x-axis, with the top edge of the cube being pulled down bringing the top
UIView
onto the screen. Likewise with a view on the bottom of the cube, dragging upwards would bring the bottom view onto the screen.I think this would only work if the
GKLCubeViewController
is a cube though. Unless for prisms the top / bottom views are never allowed to become the main view, i.e. x-axis rotation is constrained to a certain angle.The text was updated successfully, but these errors were encountered: