Skip to content

Commit

Permalink
Content animation manual stop fixes #97
Browse files Browse the repository at this point in the history
  • Loading branch information
vhailor13 committed Feb 16, 2017
1 parent bc0aeb8 commit 93351e4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Source/animation/AnimationProducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ class AnimationProducer {
}

let progress = currentDate.timeIntervalSince(animationDesc.startDate) / animation.duration

// Completion
if progress >= 1.0 {

// Final update
Expand All @@ -337,9 +339,16 @@ class AnimationProducer {
continue
}


let t = progressForTimingFunction(animation.easing, progress: progress)
group.contents = animation.getVFunc()(t)
animation.onProgressUpdate?(progress)

// Manual stop
if animation.manualStop {
contentsAnimations.remove(at: index)
animationDesc.cache.freeLayer(group)
}
}
}
}

0 comments on commit 93351e4

Please sign in to comment.