Class: MotionWizard::AnimationStrategy::Ios7SlideRightToLeft
- Inherits:
-
SlideAnimation
- Object
- BaseAnimationStrategy
- SlideAnimation
- MotionWizard::AnimationStrategy::Ios7SlideRightToLeft
- Defined in:
- lib/motion-wizard/animation_strategy/ios7_slide_right_to_left.rb
Instance Attribute Summary
Attributes inherited from SlideAnimation
Attributes inherited from BaseAnimationStrategy
#already_on_final_position, #duration
Instance Method Summary collapse
- #animate ⇒ Object
-
#initialize ⇒ Ios7SlideRightToLeft
constructor
A new instance of Ios7SlideRightToLeft.
Methods inherited from SlideAnimation
Methods inherited from BaseAnimationStrategy
Constructor Details
#initialize ⇒ Ios7SlideRightToLeft
Returns a new instance of Ios7SlideRightToLeft.
4 5 6 7 |
# File 'lib/motion-wizard/animation_strategy/ios7_slide_right_to_left.rb', line 4 def initialize super @duration = 0.25 end |
Instance Method Details
#animate ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/motion-wizard/animation_strategy/ios7_slide_right_to_left.rb', line 9 def animate show_view_index = @show_view.superview.subviews.index(@show_view) hide_view_index = @show_view.superview.subviews.index(@hide_view) @show_view.superview.exchangeSubviewAtIndex(hide_view_index, withSubviewAtIndex: show_view_index) if show_view_index < hide_view_index (@show_view, App.frame.size.width, 0, @show_view_after_block) (@hide_view, 0, -70, @hide_view_after_block) end |