Merge branch 'refactor_api_style' into 5.x

* refactor_api_style:
  Use property instead of method for UIButton/NSButton current url.
This commit is contained in:
DreamPiggy 2018-02-19 20:48:03 +08:00
commit da807416b0
3 changed files with 4 additions and 15 deletions

View File

@ -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`.

View File

@ -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

View File

@ -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.