| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- //
- // RAHomeOrderModel.m
- // Apex And Drivers
- //
- // Created by Jack on 2018/6/1.
- // Copyright © 2018年 USAI. All rights reserved.
- //
- #import "RAHomeOrderModel.h"
- #import "UIImage+RedAnt.h"
- @implementation RAHomeOrderModel {
- UIImage *_icon;
- }
- - (void)setValue:(id)value forUndefinedKey:(NSString *)key {
-
- }
- - (UIImage *)icon {
- return _icon;
- }
- - (void)setIcon:(UIImage *)icon {
- _icon = icon;
-
- if (self.delegate && [self.delegate respondsToSelector:@selector(refreshUI)]) {
- dispatch_async(dispatch_get_main_queue(), ^{
- [self.delegate refreshUI];
- });
- }
- }
- //- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
- // [super setValuesForKeysWithDictionary:keyedValues];
- //
- // [self setIconURL:@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536134884&di=9ea523019212b373ac04f4411e8aa56b&imgtype=jpg&er=1&src=http%3A%2F%2Fp3.music.126.net%2Fyp-UZgqWp6FV_AN4hPozjQ%3D%3D%2F109951163414711232.jpg"];
- //}
- - (void)setIconURL:(NSString *)iconURL {
- _iconURL = iconURL;
- if (_iconURL.length > 0 && [_iconURL hasPrefix:@"http"]) {
- __weak typeof(self) weakSelf = self;
- [RASingleton.sharedInstance.networkQueue addOperationWithBlock:^{
-
- UIImage *icon = [UIImage ra_imageWithURL:[NSURL URLWithString:iconURL]];
-
- if (weakSelf) {
- __strong typeof(weakSelf) strongSelf = weakSelf;
- [strongSelf setIcon:icon];
- }
-
- }];
- }
- }
- @end
|