Skip to content

Commit

Permalink
Support removing animation by setting name to nil
Browse files Browse the repository at this point in the history
  • Loading branch information
chuganzy committed Mar 21, 2019
1 parent e48841a commit 123090c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lottie-swift/src/Public/Animation/AnimationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ final public class AnimationView: LottieView {
/// Set animation name from Interface Builder
@IBInspectable var animationName: String? {
didSet {
if let name = animationName {
self.animation = Animation.named(name, animationCache: nil)
self.animation = animationName.flatMap {
Animation.named($0, animationCache: nil)
}
}
}
Expand Down

0 comments on commit 123090c

Please sign in to comment.