Skip to content

Commit 615fb19

Browse files
authored
Merge pull request #141 from QuickBlox/development
Development
2 parents c76569f + 5b01690 commit 615fb19

36 files changed

Lines changed: 337 additions & 222 deletions

File tree

PublicCocoaPods/.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3
1+
4

PublicCocoaPods/QMChatViewController.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Pod::Spec.new do |s|
2828
s.homepage = "https://github.com/QuickBlox/QMChatViewController-ios"
2929
s.license = { :type => "BSD", :file => "LICENSE" }
3030
s.authors = {"Andrey Ivanov" => "andrey.ivanov@quickblox.com", "Vitaliy Gorbachov" => "vitaliy.gorbachov@quickblox.com", "Vitaliy Gurkovsky" => "vitaliy.gurkovsky@injoit.com"}
31-
s.platform = :ios, "8.0"
31+
s.platform = :ios, "9.0"
3232
s.source = { :git => "https://github.com/QuickBlox/QMChatViewController-ios.git", :tag => "#{s.version}" }
3333
s.source_files = "QMChatViewController/QMChatViewController.{h,m}"
3434

@@ -67,9 +67,9 @@ Pod::Spec.new do |s|
6767
s.requires_arc = true
6868
s.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/QuickBlox/" }
6969
s.prefix_header_contents = '#import <Quickblox/Quickblox.h>'
70-
s.dependency "QuickBlox", ">= 2.10"
71-
s.dependency "TTTAttributedLabel", "> 1.13"
72-
s.dependency "SDWebImage", "~> 4.0.0"
70+
s.dependency "QuickBlox"
71+
s.dependency "TTTAttributedLabel"
72+
s.dependency "SDWebImage"
7373
s.dependency "FFCircularProgressView"
7474

7575
end

QMCVDevelopment.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
2626
s.homepage = "https://github.com/QuickBlox/QMChatViewController-ios"
2727
s.license = { :type => "BSD", :file => "LICENSE" }
2828
s.authors = {"Andrey Ivanov" => "andrey.ivanov@quickblox.com", "Vitaliy Gorbachov" => "vitaliy.gorbachov@quickblox.com", "Vitaliy Gurkovsky" => "vitaliy.gurkovsky@injoit.com"}
29-
s.platform = :ios, "8.0"
29+
s.platform = :ios, "9.0"
3030
s.source = { :git => "https://github.com/QuickBlox/QMChatViewController-ios.git", :tag => "#{s.version}" }
3131
s.source_files = "QMChatViewController/QMChatViewController.{h,m}"
3232

@@ -73,9 +73,9 @@ Pod::Spec.new do |s|
7373
s.resource_bundles = { "QMChatViewController" => ["QMChatViewController/**/*.xib", "QMChatViewController/**/*.png"] }
7474
s.resources = "QMChatViewController/Icons/Media.xcassets"
7575
s.requires_arc = true
76-
s.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/../../Framework $(PODS_ROOT)/../External" }
77-
s.dependency "TTTAttributedLabel", "> 1.13"
78-
s.dependency "SDWebImage", "~> 4.0.0"
76+
s.dependency "TTTAttributedLabel"
77+
s.dependency "SDWebImage"
7978
s.dependency "FFCircularProgressView"
79+
s.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/../../Framework $(PODS_ROOT)/../External" }
8080

8181
end

QMChatViewController/Categories/UIImage+QM.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@
2929
+ (UIImage *)resizableImageWithColor:(UIColor *)color
3030
cornerRadius:(CGFloat)cornerRadius;
3131

32+
@property (nonatomic, strong, readonly) NSData *dataRepresentation;
33+
3234
@end

QMChatViewController/Categories/UIImage+QM.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,18 @@ + (UIImage *)resizableImageWithColor:(UIColor *)color
6363
resizingMode:UIImageResizingModeStretch];
6464
}
6565

66+
- (NSData *)dataRepresentation {
67+
68+
int alphaInfo = CGImageGetAlphaInfo(self.CGImage);
69+
BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone ||
70+
alphaInfo == kCGImageAlphaNoneSkipFirst ||
71+
alphaInfo == kCGImageAlphaNoneSkipLast);
72+
73+
if (hasAlpha) {
74+
return UIImagePNGRepresentation(self);
75+
}
76+
else {
77+
return UIImageJPEGRepresentation(self, 1.0f);
78+
}
79+
}
6680
@end

QMChatViewController/QMChatLocationSnapshotter/QMChatLocationSnapshotter.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ + (void)snapshotForLocationCoordinate:(CLLocationCoordinate2D)locationCoordinate
2222

2323
UIImage *locationSnapshot = [QMImageLoader.instance.imageCache imageFromCacheForKey:key];
2424

25-
if (locationSnapshot != nil) {
26-
25+
if (locationSnapshot) {
2726
completion(locationSnapshot);
2827
return;
2928
}

QMChatViewController/QMChatViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ - (void)dealloc {
6767
[self registerForNotifications:NO];
6868

6969
self.inputToolbar.contentView.textView.delegate = nil;
70-
self.inputToolbar.contentView.textView.pasteDelegate = nil;
70+
self.inputToolbar.contentView.textView.qm_placeholderTextViewPasteDelegate = nil;
7171
self.inputToolbar.delegate = nil;
7272

7373
self.senderDisplayName = nil;
@@ -410,7 +410,7 @@ - (void)didPressAccessoryButton:(UIButton *)sender {
410410
handler();
411411
}]];
412412

413-
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"SA_STR_CANCEL", nil)
413+
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
414414
style:UIAlertActionStyleCancel
415415
handler:nil]];
416416

@@ -979,7 +979,7 @@ - (void)showAlertForAccess {
979979
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
980980
message:message
981981
delegate:self
982-
cancelButtonTitle:NSLocalizedString(@"SA_STR_CANCEL", nil)
982+
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
983983
otherButtonTitles:NSLocalizedString(@"Open Settings", nil),nil];
984984

985985
[alert show];

QMChatViewController/Utils/QMImageLoader/QMImageLoader.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,14 @@ typedef void(^QMWebImageCompletionWithFinishedBlock)(UIImage *_Nullable image, U
4646

4747
@property (nonatomic, readonly, class) QMImageLoader *instance;
4848

49+
4950
+ (SDWebImageManager *)sharedManager NS_UNAVAILABLE;
51+
5052
- (UIImage *)originalImageWithURL:(NSURL *)url;
53+
- (BOOL)hasOriginalImageWithURL:(NSURL *)url;
54+
- (NSString *)pathForOriginalImageWithURL:(NSURL *)url;
55+
56+
5157
- (BOOL)hasImageOperationWithURL:(NSURL *)url;
5258
- (id<SDWebImageOperation>)operationWithURL:(NSURL *)url;
5359
- (void)cancelOperationWithURL:(NSURL *)url;

0 commit comments

Comments
 (0)