I added a new 'Transition' module which allows easy access to MMDrawerController's four prebuilt transition animation blocks. These create very smooth reveals for the menu. ProMotion::Menu::Drawer instances now accept the transition_animation= method which accepts one of four arguments (descriptions taken from the MMDrawerController docs:
:slide - Creates a slide visual state block that gives the user an experience that slides at the same speed of the center view controller during animation.
:slide_and_scale - Creates a slide and scale visual state block that gives an experience similar to Mailbox.app. It scales from 90% to 100%, and translates 50 pixels in the x direction. In addition, it also sets alpha from 0.0 to 1.0. This is similar to how Spotify's menu transitions.
:swinging_door - Creates a swinging door visual state block that gives the user an experience that animates the drawer in along the hinge.
:parallax - Creates a parallax experience that slides the side drawer view controller at a different rate than the center view controller during animation. For every parallaxFactor of points moved by the center view controller, the side drawer view controller will move 1 point. Passing in 1.0 is the equivalent of a applying a sliding animation, while passing in MAX_FLOAT is the equivalent of having no animation at all.
Parallax requires a parallaxFactor argument, which I've aliased here to be appended onto the :parallax symbol passed into transition_animation=. I.e. For a parallax factor of 5 one would pass :parallax_5. When only :parallax is passed in, the parallax factor defaults to 3.
Descriptions of the individual visual state animation blocks (same as above) are included in the VISUAL_STATES hash in the Transition module.
Tests, though admittedly they are somewhat weak, are also included.
I added a new 'Transition' module which allows easy access to MMDrawerController's four prebuilt transition animation blocks. These create very smooth reveals for the menu. ProMotion::Menu::Drawer instances now accept the
transition_animation=
method which accepts one of four arguments (descriptions taken from the MMDrawerController docs::slide
- Creates a slide visual state block that gives the user an experience that slides at the same speed of the center view controller during animation.:slide_and_scale
- Creates a slide and scale visual state block that gives an experience similar to Mailbox.app. It scales from 90% to 100%, and translates 50 pixels in the x direction. In addition, it also sets alpha from 0.0 to 1.0. This is similar to how Spotify's menu transitions.:swinging_door
- Creates a swinging door visual state block that gives the user an experience that animates the drawer in along the hinge.:parallax
- Creates a parallax experience that slides the side drawer view controller at a different rate than the center view controller during animation. For every parallaxFactor of points moved by the center view controller, the side drawer view controller will move 1 point. Passing in 1.0 is the equivalent of a applying a sliding animation, while passing in MAX_FLOAT is the equivalent of having no animation at all.parallaxFactor
argument, which I've aliased here to be appended onto the :parallax symbol passed intotransition_animation=
. I.e. For a parallax factor of 5 one would pass:parallax_5
. When only:parallax
is passed in, the parallax factor defaults to 3.Descriptions of the individual visual state animation blocks (same as above) are included in the VISUAL_STATES hash in the Transition module.
Tests, though admittedly they are somewhat weak, are also included.