Commit 876d9bb9 authored by 艾娇平's avatar 艾娇平

Merge branch 'ajp-7.15.0' into 'master'

添加SDWebImage依赖

See merge request !15
parents dbce5ee6 c4fb3dd6
...@@ -17,4 +17,5 @@ Pod::Spec.new do |s| ...@@ -17,4 +17,5 @@ Pod::Spec.new do |s|
s.dependency 'GMPhobos' s.dependency 'GMPhobos'
s.dependency 'GMHud' s.dependency 'GMHud'
s.dependency 'GMKit' s.dependency 'GMKit'
s.dependency 'SDWebImage'
end end
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
@interface GMJailbreak : NSObject @interface GMJailbreak : NSObject
+ (BOOL)isJailbreak; + (BOOL)isJailbreak;
@end @end
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import "GMBaseUtil.h" #import "GMBaseUtil.h"
@import GMKit; @import GMKit;
@import SDWebImage;
@interface OCNavigationBarButton () @interface OCNavigationBarButton ()
@property (nonatomic, assign) CGFloat adaptiveWidth; @property (nonatomic, assign) CGFloat adaptiveWidth;
...@@ -209,7 +210,8 @@ ...@@ -209,7 +210,8 @@
- (void)setNearRightIconURL:(NSString *)nearRightIconURL { - (void)setNearRightIconURL:(NSString *)nearRightIconURL {
_nearRightIconURL = nearRightIconURL; _nearRightIconURL = nearRightIconURL;
_nearRightButton.hidden = NO; _nearRightButton.hidden = NO;
[[SDWebImageManager sharedManager] downloadImageWithURL:[NSURL URLWithString:_nearRightIconURL] options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
[[SDWebImageDownloader sharedDownloader] downloadImageWithURL:[NSURL URLWithString:_nearRightIconURL] completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
if (image) { if (image) {
UIImage *scaledImage = [image resizeToDeviceScale]; UIImage *scaledImage = [image resizeToDeviceScale];
[_nearRightButton setImage:scaledImage forState:UIControlStateNormal]; [_nearRightButton setImage:scaledImage forState:UIControlStateNormal];
...@@ -221,14 +223,14 @@ ...@@ -221,14 +223,14 @@
- (void)setRightIconURL:(NSString *)rightIconURL { - (void)setRightIconURL:(NSString *)rightIconURL {
_rightIconURL = rightIconURL; _rightIconURL = rightIconURL;
_rightButton.hidden = NO; _rightButton.hidden = NO;
[[SDWebImageManager sharedManager] downloadImageWithURL:[NSURL URLWithString:rightIconURL] options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { [[SDWebImageDownloader sharedDownloader] downloadImageWithURL:[NSURL URLWithString:rightIconURL] completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
if (image) { if (image) {
UIImage *scaledImage = [image resizeToDeviceScale]; UIImage *scaledImage = [image resizeToDeviceScale];
[_rightButton setImage:scaledImage forState:UIControlStateNormal]; [_rightButton setImage:scaledImage forState:UIControlStateNormal];
} }
}]; }];
[self layoutTitle]; [self layoutTitle];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment