Skip to content

Commit 6d75449

Browse files
committed
Merge pull request xhzengAIB#1 from xhzengAIB/master
合并原作者的更新内容
2 parents 80af37b + bfdddf2 commit 6d75449

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

MessageDisplayKit.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Pod::Spec.new do |s|
22
s.name = "MessageDisplayKit"
3-
s.version = "0.2.7"
3+
s.version = "0.2.8"
44
s.summary = "An IM App like WeChat App has to send text, pictures, audio, video, location messaging, managing address book, more interesting features."
55
s.homepage = "https://github.com/xhzengAIB/MessageDisplayKit"
66
s.license = "MIT"
77
s.authors = { "Jack" => "xhzengAIB@gmail.com" }
8-
s.source = { :git => "https://github.com/xhzengAIB/MessageDisplayKit.git", :tag => "v0.2.7" }
8+
s.source = { :git => "https://github.com/xhzengAIB/MessageDisplayKit.git", :tag => "v0.2.8" }
99
s.frameworks = 'Foundation', 'CoreGraphics', 'UIKit', 'MobileCoreServices', 'AVFoundation', 'CoreLocation', 'MediaPlayer', 'CoreMedia', 'CoreText', 'AudioToolbox'
1010
s.platform = :ios, '6.0'
1111
s.source_files = 'MessageDisplayKit/Classes/**/*.{h,m}'

MessageDisplayKit/Classes/Views/MessageContentViews/XHBubblePhotoImageView.m

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,24 @@ - (void)configureMessagePhoto:(UIImage *)messagePhoto thumbnailUrl:(NSString *)t
5555
if ([url.absoluteString isEqualToString:thumbnailUrl]) {
5656

5757
if (CGRectEqualToRect(weakSelf.bounds, CGRectZero)) {
58-
weakSelf.semaphore = dispatch_semaphore_create(0);
59-
dispatch_semaphore_wait(weakSelf.semaphore, DISPATCH_TIME_FOREVER);
60-
weakSelf.semaphore = nil;
58+
if (weakSelf) {
59+
weakSelf.semaphore = dispatch_semaphore_create(0);
60+
dispatch_semaphore_wait(weakSelf.semaphore, DISPATCH_TIME_FOREVER);
61+
weakSelf.semaphore = nil;
62+
}
6163
}
6264

63-
image = [image thumbnailImage:CGRectGetWidth(weakSelf.bounds) * 2 transparentBorder:0 cornerRadius:0 interpolationQuality:1.0];
65+
// if image not nil
6466
if (image) {
67+
// scale image
68+
image = [image thumbnailImage:CGRectGetWidth(weakSelf.bounds) * 2 transparentBorder:0 cornerRadius:0 interpolationQuality:1.0];
6569
dispatch_async(dispatch_get_main_queue(), ^{
66-
weakSelf.messagePhoto = image;
67-
[weakSelf.activityIndicatorView stopAnimating];
70+
// if image not nil
71+
if (image) {
72+
// show image
73+
weakSelf.messagePhoto = image;
74+
[weakSelf.activityIndicatorView stopAnimating];
75+
}
6876
});
6977
}
7078
}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ An IM APP like WeChat App has to send text, pictures, audio, video, location mes
99

1010
It's ok if you don't understand how the code works. Most code has comments, which I believe will help you a lot. Feel free to [open an issue] (https://github.com/xhzengAIB/MessageDisplayKit/issues?state=open) if you have any questions. I will do my best to answer them.
1111

12+
很多朋友说不能直接编译该项目的主要工程,其实原因很简单,只是没有打包静态库的插件,需要安装一个Xcode插件,点击以下链接[iOS-Universal-Framework](https://github.com/kstenerud/iOS-Universal-Framework),安装方法很简单的,里面有教程,只要安装了该插件后,重启你的xcode,就可以开始编译了!
13+
1214
## 开源许可协议
1315
很多人和我说,你不知道什么是开源许可协议,其实我也不清楚他是不知道还是不想知道,作为一个开发者,不懂得尊重别人的成果,那你到底想怎样,你自己最清楚。
1416
说一件事吧!曾经我也这么做了,没尊重作者的成果,最终被人鄙视了一段时间,于是我删除了那个开源库,现在终于明白,尊重这个词,这对于别人来说是一个认可,我们不可以剥夺这份利益。

0 commit comments

Comments
 (0)