andreamazz / SlideOutNavigation

SlideOut Navigation Controller for iOS.
MIT License
210 stars 49 forks source link

Slide animation #30

Closed iesta closed 10 years ago

iesta commented 10 years ago

Hi, Great control :-) Would it be easy to add a slide animation for the menu ? Thank you !

andreamazz commented 10 years ago

Hi @iesta, thanks! What do you mean by slide animation? Let the menu slide over the content or have it slide from the left with the content controller? The second option is definitely feisable, I'll work on it.

iesta commented 10 years ago

Yes i was thinking about the second option. Wunderlist app does it. I have tried to do it myself but i do not really understand how it works...

andreamazz commented 10 years ago

Hi @iesta, check commit efc6d98d63b3863f94de533b355155e047609765 The animation is disabled by default. You can enable it easily in the options:

                       AMOptionsAnimationShrink: @NO,
                       AMOptionsAnimationDarken: @NO,
                        AMOptionsAnimationSlide: @YES,
              AMOptionsAnimationSlidePercentage: @0.3f,

This mimics the behaviour of Wunderlist. I have to make some other adjustments to the component, so I'll push the new version to cocoapods tomorrow, in case you use it.

:beers:

iesta commented 10 years ago

Hi Thank you very much. I will test that now :-) I have a small question for you as i want to use your slider in an app but i d' like to add some stuff to the navigation bar (like a dynamic button like a cart on the right side). What do you think would be the best way ? Thanks in advance,

andreamazz commented 10 years ago

Hi @iesta, you can access the navigation bar as you would in every other iOS application. To add a button on the right you can use something like this in any controller handled by the slideout controller:

    [self.navigationItem setRightBarButtonItem:button];

Where button is a UIBarButtonItem instance.

You can also customize the navbar appearance using the static class appearance:

    [[UINavigationBar appearance] setTintColor:[UIColor redColor]];

It behaves like a normal UINavigationController.