Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #97 from holgersindbaek/master
Browse files Browse the repository at this point in the history
Added ability to set the animation duration for fading in the image
  • Loading branch information
kean committed Mar 30, 2016
2 parents a350e2e + 6c398cf commit 892346d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Pod/Source/UI/DFImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
*/
@property (nonatomic) BOOL allowsAnimations;

/*! Duration it will take to animate image in if image view allows animations.
*/
@property (nonatomic) CGFloat fadeDuration;

/*! Performs any clean up necessary to prepare the view for use again. Removes currently displayed image and cancels all requests registered with a receiver.
*/
- (void)prepareForReuse;
Expand Down
3 changes: 2 additions & 1 deletion Pod/Source/UI/DFImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder {
- (void)_commonInit {
self.imageManager = [DFImageManager sharedManager];
_allowsAnimations = YES;
_fadeDuration = 0.25f;
}

- (void)prepareForReuse {
Expand Down Expand Up @@ -84,7 +85,7 @@ - (void)didCompleteImageTask:(nonnull DFImageTask *)task withImage:(nullable UII
animation.keyPath = @"opacity";
animation.fromValue = @0.f;
animation.toValue = @1.f;
animation.duration = 0.25f;
animation.duration = self.fadeDuration;
animation;
}) forKey:@"opacity"];
} else {
Expand Down

0 comments on commit 892346d

Please sign in to comment.