From e5cb977bc8b042e5a8f005b019d147ec5d731484 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Fri, 26 Jan 2018 22:40:28 +0800 Subject: [PATCH] Use property instead of method for UIButton/NSButton current url. --- SDWebImage/NSButton+WebCache.h | 4 ++-- SDWebImage/SDWebImageTransition.h | 11 ----------- SDWebImage/UIButton+WebCache.h | 4 ++-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/SDWebImage/NSButton+WebCache.h b/SDWebImage/NSButton+WebCache.h index 57f7115e..33f84ba0 100644 --- a/SDWebImage/NSButton+WebCache.h +++ b/SDWebImage/NSButton+WebCache.h @@ -19,7 +19,7 @@ /** * Get the current image URL. */ -- (nullable NSURL *)sd_currentImageURL; +@property (nonatomic, strong, readonly, nullable) NSURL *sd_currentImageURL; /** * Set the button `image` with an `url`. @@ -133,7 +133,7 @@ /** * Get the current alternateImage URL. */ -- (nullable NSURL *)sd_currentAlternateImageURL; +@property (nonatomic, strong, readonly, nullable) NSURL *sd_currentAlternateImageURL; /** * Set the button `alternateImage` with an `url`. diff --git a/SDWebImage/SDWebImageTransition.h b/SDWebImage/SDWebImageTransition.h index 01925947..0c364ea0 100644 --- a/SDWebImage/SDWebImageTransition.h +++ b/SDWebImage/SDWebImageTransition.h @@ -67,8 +67,6 @@ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished); @interface SDWebImageTransition (Conveniences) -// class property is available in Xcode 8. We will drop the Xcode 7.3 support in 5.x -#if __has_feature(objc_class_property) /// Fade transition. @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *fadeTransition; /// Flip from left transition. @@ -83,15 +81,6 @@ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished); @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlUpTransition; /// Curl down transition. @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlDownTransition; -#else -+ (nonnull instancetype)fadeTransition; -+ (nonnull instancetype)flipFromLeftTransition; -+ (nonnull instancetype)flipFromRightTransition; -+ (nonnull instancetype)flipFromTopTransition; -+ (nonnull instancetype)flipFromBottomTransition; -+ (nonnull instancetype)curlUpTransition; -+ (nonnull instancetype)curlDownTransition; -#endif @end diff --git a/SDWebImage/UIButton+WebCache.h b/SDWebImage/UIButton+WebCache.h index 61fada62..ffe80651 100644 --- a/SDWebImage/UIButton+WebCache.h +++ b/SDWebImage/UIButton+WebCache.h @@ -22,7 +22,7 @@ /** * Get the current image URL. */ -- (nullable NSURL *)sd_currentImageURL; +@property (nonatomic, strong, readonly, nullable) NSURL *sd_currentImageURL; /** * Get the image URL for a control state. @@ -133,7 +133,7 @@ /** * Get the current background image URL. */ -- (nullable NSURL *)sd_currentBackgroundImageURL; +@property (nonatomic, strong, readonly, nullable) NSURL *sd_currentBackgroundImageURL; /** * Get the background image URL for a control state.