集成源码weex的时候 发现按weex官网的步骤集成 renderUrl 永远是失败的
最后发现官网的集成文档里 少写了集成需要的依赖
这是weex初期版本的集成文档
https://open.taobao.com/doc2/detail?spm=a219a.7629140.0.0.tFddsV&&docType=1&articleId=104829
这是weex官网集成文档
https://weex.apache.org/cn/guide/integrate-to-your-app.html#ji-cheng-dao-ios
注意 !!
这些都要引入!!!!
这些 我都引入了 才可以!!
对了源码集成要自己写图片下载
附上源码
-
(id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)userInfo completed:(void(^)(UIImage *image, NSError *error, BOOL finished))completedBlock
{
if ([url hasPrefix:@"//"]) {
url = [@"http:" stringByAppendingString:url];
}SDWebImageManager *imgWeb = [SDWebImageManager sharedManager];
return (id<WXImageOperationProtocol>)[imgWeb loadImageWithURL:[NSURL URLWithString:url] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
if(completedBlock) {
completedBlock(image, error, finished);
};
}];
}
这个是从 这里 https://weex.apache.org/cn/guide/extend-ios.html 官网上拿的