// // RADetailSignatureModel.m // Apex And Drivers // // Created by Jack on 2018/9/4. // Copyright © 2018年 USAI. All rights reserved. // #import "RADetailSignatureModel.h" #import "UIImage+RedAnt.h" @implementation RADetailSignatureModel - (void)setSignatureURL:(NSString *)signatureURL { _signatureURL = signatureURL; if (_signatureURL.length > 0) { __weak typeof(self) weakSelf = self; [RASingleton.sharedInstance.networkQueue addOperationWithBlock:^{ UIImage *signature = [UIImage ra_imageWithURL:[NSURL URLWithString:signatureURL]]; if (weakSelf) { __strong typeof(weakSelf) strongSelf = weakSelf; [strongSelf setSignature:signature]; } }]; } else { self.signature = nil; } } - (void)setSignature:(UIImage *)signature { _signature = signature; if (self.delegate && [self.delegate respondsToSelector:@selector(refreshUI)]) { dispatch_async(dispatch_get_main_queue(), ^{ [self.delegate refreshUI]; }); } } - (CGFloat)height { return 150.0f; } @end