Merge pull request #2315 from dreampiggy/improvement_image_transition_user_interaction
Add `UIViewAnimationOptionAllowUserInteraction` as default options for convenient image transition
This commit is contained in:
commit
12fe445498
|
@ -62,7 +62,7 @@ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished);
|
|||
@end
|
||||
|
||||
// Convenience way to create transition. Remember to specify the duration if needed.
|
||||
// for UIKit, these transition just use the correspond `animationOptions`
|
||||
// for UIKit, these transition just use the correspond `animationOptions`. By default we enable `UIViewAnimationOptionAllowUserInteraction` to allow user interaction during transition.
|
||||
// for AppKit, these transition use Core Animation in `animations`. So your view must be layer-backed. Set `wantsLayer = YES` before you apply it.
|
||||
|
||||
@interface SDWebImageTransition (Conveniences)
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
+ (SDWebImageTransition *)fadeTransition {
|
||||
SDWebImageTransition *transition = [SDWebImageTransition new];
|
||||
#if SD_UIKIT
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionCrossDissolve;
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionCrossDissolve | UIViewAnimationOptionAllowUserInteraction;
|
||||
#else
|
||||
transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) {
|
||||
CATransition *trans = [CATransition animation];
|
||||
|
@ -45,7 +45,7 @@
|
|||
+ (SDWebImageTransition *)flipFromLeftTransition {
|
||||
SDWebImageTransition *transition = [SDWebImageTransition new];
|
||||
#if SD_UIKIT
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionFlipFromLeft;
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionFlipFromLeft | UIViewAnimationOptionAllowUserInteraction;
|
||||
#else
|
||||
transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) {
|
||||
CATransition *trans = [CATransition animation];
|
||||
|
@ -60,7 +60,7 @@
|
|||
+ (SDWebImageTransition *)flipFromRightTransition {
|
||||
SDWebImageTransition *transition = [SDWebImageTransition new];
|
||||
#if SD_UIKIT
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionFlipFromRight;
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionFlipFromRight | UIViewAnimationOptionAllowUserInteraction;
|
||||
#else
|
||||
transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) {
|
||||
CATransition *trans = [CATransition animation];
|
||||
|
@ -75,7 +75,7 @@
|
|||
+ (SDWebImageTransition *)flipFromTopTransition {
|
||||
SDWebImageTransition *transition = [SDWebImageTransition new];
|
||||
#if SD_UIKIT
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionFlipFromTop;
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionFlipFromTop | UIViewAnimationOptionAllowUserInteraction;
|
||||
#else
|
||||
transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) {
|
||||
CATransition *trans = [CATransition animation];
|
||||
|
@ -90,7 +90,7 @@
|
|||
+ (SDWebImageTransition *)flipFromBottomTransition {
|
||||
SDWebImageTransition *transition = [SDWebImageTransition new];
|
||||
#if SD_UIKIT
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionFlipFromBottom;
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionFlipFromBottom | UIViewAnimationOptionAllowUserInteraction;
|
||||
#else
|
||||
transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) {
|
||||
CATransition *trans = [CATransition animation];
|
||||
|
@ -105,7 +105,7 @@
|
|||
+ (SDWebImageTransition *)curlUpTransition {
|
||||
SDWebImageTransition *transition = [SDWebImageTransition new];
|
||||
#if SD_UIKIT
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionCurlUp;
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionCurlUp | UIViewAnimationOptionAllowUserInteraction;
|
||||
#else
|
||||
transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) {
|
||||
CATransition *trans = [CATransition animation];
|
||||
|
@ -120,7 +120,7 @@
|
|||
+ (SDWebImageTransition *)curlDownTransition {
|
||||
SDWebImageTransition *transition = [SDWebImageTransition new];
|
||||
#if SD_UIKIT
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionCurlDown;
|
||||
transition.animationOptions = UIViewAnimationOptionTransitionCurlDown | UIViewAnimationOptionAllowUserInteraction;
|
||||
#else
|
||||
transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) {
|
||||
CATransition *trans = [CATransition animation];
|
||||
|
|
Loading…
Reference in New Issue