andreamazz / BubbleTransition

A custom modal transition that presents and dismiss a controller with an expanding bubble effect.
MIT License
3.32k stars 250 forks source link

How can I use this as a menu? #10

Closed AbdullahAli closed 9 years ago

AbdullahAli commented 9 years ago

I would like to use this as a modal menu for presenting options to the user. Something like:

unnamed

Can you please give me an idea of how I can achieve this?

andreamazz commented 9 years ago

It can be done I guess, but it requires some tinkering. I'll work on it in the next few days, it looks pretty cool.

AbdullahAli commented 9 years ago

That would be pretty sweet! Please let me know how you get on, and if I can help in any way @andreamazz

Here is a reference which tries to achieve this effect (although it is done slightly differently to yours): http://holko.pl/2014/06/26/recreating-skypes-action-sheet-animation/

andreamazz commented 9 years ago

Yeah, I don't know if I'll be adding the wobbly effect too :)
I'm having a bit of trouble on finding a way to parametrize the view that needs to be expanded. Passing a view as parameter is not an option since the outlets are not set at the time of the transition, while passing a rect with the view size is not a great API design and doesn't play well with autolayout. Any idea is welcome :)

AbdullahAli commented 9 years ago

hey @andreamazz

I was looking at the blog mentioned (and also: http://victorbaro.com/2014/07/vbfjellyview-tutorial/) and a few other examples, what they do is they initialize the controller with the view and have it set as a stored property. Then when the button is clicked, they play a similar sequence of animation as your example). I guess the main thing they do is have 1 controller and an overlayed view (avoids the parametrizing the view), as opposed to have two controllers and segue-ing between them (since in this case the view would not be set)

Create a new branch and tag me with what you have done so far (passing the frame size) and let me have a look and wrap my head around it

andreamazz commented 9 years ago

Yep, that's fine if your menu is a subview, but this is meant to be a custom transition. I'm not sure that's the best course of action, it would fit better a whole new lib dedicated to that. I might work on it in the next few days.

AbdullahAli commented 9 years ago

you are right, I agree @andreamazz I think jamming it into this lib would create a 3 headed and 5 legged monster :laughing:

when you create the new project tag me in and I'll start watching it and add some commits/suggestions too :+1:

AbdullahAli commented 9 years ago

Any luck @andreamazz :smile_cat:

andreamazz commented 9 years ago

Sorry, not yet. I'm pretty swamped at the moment, I don't see this happening in the short term to be honest. I'll keep you posted if I do. In the meantime I'm closing this issue.