Class: MotionWizard::AnimationStrategy::Ios7SlideLeftToRight

Inherits:
SlideAnimation show all
Defined in:
lib/motion-wizard/animation_strategy/ios7_slide_left_to_right.rb

Instance Attribute Summary

Attributes inherited from SlideAnimation

#direction

Attributes inherited from BaseAnimationStrategy

#already_on_final_position, #duration

Instance Method Summary collapse

Methods inherited from SlideAnimation

#do_slide_animation

Methods inherited from BaseAnimationStrategy

#hide_view, #show_view

Constructor Details

#initializeIos7SlideLeftToRight

Returns a new instance of Ios7SlideLeftToRight.



4
5
6
7
# File 'lib/motion-wizard/animation_strategy/ios7_slide_left_to_right.rb', line 4

def initialize
  super
  @duration = 0.25
end

Instance Method Details

#animateObject



9
10
11
12
13
14
15
# File 'lib/motion-wizard/animation_strategy/ios7_slide_left_to_right.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
  do_slide_animation(@show_view, -70, 0, @show_view_after_block)
  do_slide_animation(@hide_view, 0, App.frame.size.width, @hide_view_after_block)
end