SDWebImageTransition

@interface SDWebImageTransition : NSObject

This class is used to provide a transition animation after the view category load image finished. Use this on sd_imageTransition in UIView+WebCache.h for UIKit(iOS & tvOS), we use +[UIView transitionWithView:duration:options:animations:completion] for transition animation. for AppKit(macOS), we use +[NSAnimationContext runAnimationGroup:completionHandler:] for transition animation. You can call +[NSAnimationContext currentContext] to grab the context during animations block.

Note

These transition are provided for basic usage. If you need complicated animation, consider to directly use Core Animation or use SDWebImageAvoidAutoSetImage and implement your own after image load finished.

Conveniences

  • Fade-in transition.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull, class) SDWebImageTransition *fadeTransition;

    Swift

    class var fade: SDWebImageTransition { get }
  • Flip from left transition.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull, class) SDWebImageTransition *flipFromLeftTransition;

    Swift

    class var flipFromLeft: SDWebImageTransition { get }
  • Flip from right transition.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull, class) SDWebImageTransition *flipFromRightTransition;

    Swift

    class var flipFromRight: SDWebImageTransition { get }
  • Flip from top transition.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull, class) SDWebImageTransition *flipFromTopTransition;

    Swift

    class var flipFromTop: SDWebImageTransition { get }
  • Flip from bottom transition.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull, class) SDWebImageTransition *flipFromBottomTransition;

    Swift

    class var flipFromBottom: SDWebImageTransition { get }
  • Curl up transition.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull, class) SDWebImageTransition *curlUpTransition;

    Swift

    class var curlUp: SDWebImageTransition { get }
  • Curl down transition.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull, class) SDWebImageTransition *curlDownTransition;

    Swift

    class var curlDown: SDWebImageTransition { get }
  • Fade-in transition with duration.

    Declaration

    Objective-C

    + (nonnull instancetype)fadeTransitionWithDuration:(NSTimeInterval)duration;

    Swift

    class func fade(duration: TimeInterval) -> Self

    Parameters

    duration

    transition duration, use ease-in-out

  • Flip from left transition with duration.

    Declaration

    Objective-C

    + (nonnull instancetype)flipFromLeftTransitionWithDuration:
        (NSTimeInterval)duration;

    Swift

    class func flipFromLeft(duration: TimeInterval) -> Self

    Parameters

    duration

    transition duration, use ease-in-out

  • Flip from right transition with duration.

    Declaration

    Objective-C

    + (nonnull instancetype)flipFromRightTransitionWithDuration:
        (NSTimeInterval)duration;

    Swift

    class func flipFromRight(duration: TimeInterval) -> Self

    Parameters

    duration

    transition duration, use ease-in-out

  • Flip from top transition with duration.

    Declaration

    Objective-C

    + (nonnull instancetype)flipFromTopTransitionWithDuration:
        (NSTimeInterval)duration;

    Swift

    class func flipFromTop(duration: TimeInterval) -> Self

    Parameters

    duration

    transition duration, use ease-in-out

  • Flip from bottom transition with duration.

    Declaration

    Objective-C

    + (nonnull instancetype)flipFromBottomTransitionWithDuration:
        (NSTimeInterval)duration;

    Swift

    class func flipFromBottom(duration: TimeInterval) -> Self

    Parameters

    duration

    transition duration, use ease-in-out

  • Curl up transition with duration.

    Declaration

    Objective-C

    + (nonnull instancetype)curlUpTransitionWithDuration:(NSTimeInterval)duration;

    Swift

    class func curlUp(duration: TimeInterval) -> Self

    Parameters

    duration

    transition duration, use ease-in-out

  • Curl down transition with duration.

    Declaration

    Objective-C

    + (nonnull instancetype)curlDownTransitionWithDuration:(NSTimeInterval)duration;

    Swift

    class func curlDown(duration: TimeInterval) -> Self

    Parameters

    duration

    transition duration, use ease-in-out