Skip to content

Commit

Permalink
Merge pull request #151 from QuickBlox/development
Browse files Browse the repository at this point in the history
fixed warnings
  • Loading branch information
pro100andrey authored May 10, 2018
2 parents f3fab1d + 33b6315 commit e07a64b
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 146 deletions.
2 changes: 1 addition & 1 deletion PublicCocoaPods/QMChatViewController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Pod::Spec.new do |s|

s.name = "QMChatViewController"
s.version = "0.6.5"
s.version = "0.6.6"
s.summary = "An elegant ready-to-go chat view controller for iOS chat applications that use Quickblox communication backend."

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion QMChatViewController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|

s.name = "QMChatViewController"
s.version = "0.6.5"
s.version = "0.6.6"
s.summary = "An elegant ready-to-go chat view controller for iOS chat applications that use Quickblox communication backend."

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion QMChatViewController/QMChatDataSource/QMChatDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ - (void)changeDataSourceWithMessages:(NSArray *)messages forUpdateType:(QMDataSo
NSMutableArray *messagesArray = [NSMutableArray arrayWithCapacity:messages.count];
NSEnumerator *enumerator = [messages objectEnumerator];

if (_customDividerInterval > 0 && updateType == QMDataSourceActionTypeAdd) {
if (self.customDividerInterval > 0 && updateType == QMDataSourceActionTypeAdd) {

NSSortDescriptor *dateSentDescriptor =
[NSSortDescriptor sortDescriptorWithKey:@"dateSent" ascending:YES];
Expand Down
35 changes: 18 additions & 17 deletions QMChatViewController/QMChatViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
const NSUInteger kQMSystemInputToolbarDebugHeight = 0;

@interface QMChatViewController () <QMInputToolbarDelegate, UIImagePickerControllerDelegate,
UINavigationControllerDelegate, UIActionSheetDelegate, UIScrollViewDelegate, UIAlertViewDelegate,
UINavigationControllerDelegate, UIActionSheetDelegate, UIScrollViewDelegate,
QMChatDataSourceDelegate, QMAudioRecordToolbarDelegate>

@property (weak, nonatomic) IBOutlet QMChatCollectionView *collectionView;
Expand Down Expand Up @@ -68,8 +68,7 @@ - (void)dealloc {
self.inputToolbar.contentView.textView.delegate = nil;
self.inputToolbar.contentView.textView.qm_placeholderTextViewPasteDelegate = nil;
self.inputToolbar.delegate = nil;

self.senderDisplayName = nil;

}

- (void)viewDidLoad {
Expand Down Expand Up @@ -710,14 +709,6 @@ - (void)textViewDidEndEditing:(UITextView *)textView {
}
}

#pragma mark - UIAlertViewDelegate

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}
}

#pragma mark - UIImagePickerControllerDelegate

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
Expand Down Expand Up @@ -982,13 +973,23 @@ - (void)showAlertForAccess {
message = NSLocalizedString(@"You can allow access to Photos in Settings", nil);
}

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
message:message
delegate:self
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
otherButtonTitles:NSLocalizedString(@"Open Settings", nil),nil];
UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:title
message:message
preferredStyle:UIAlertControllerStyleAlert];

[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Open Settings", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull __unused action)
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}]];

[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
style:UIAlertActionStyleCancel
handler:nil]];

[alert show];
[self presentViewController:alertController animated:YES completion:nil];
}

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment version="2048" identifier="iOS"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -138,7 +138,7 @@
<outlet property="topLabelHeightConstraint" destination="VYw-Ld-ar1" id="SGp-H8-Qeb"/>
<outlet property="topLabelTextViewVerticalSpaceConstraint" destination="mbp-Hv-6Tq" id="OJk-NT-Qbw"/>
</connections>
<point key="canvasLocation" x="256.5" y="369"/>
<point key="canvasLocation" x="-35" y="-8"/>
</collectionViewCell>
</objects>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -96,67 +96,6 @@
- (void)messagesInputToolbar:(QMInputToolbar *)toolbar
didPressLeftBarButton:(UIButton *)sender;

@optional

/**
Asks the delegate if it can start the audio recording by touching the audio record button.
@param toolbar An instance of `QMInputToolbar`
@return YES if the audio recording should start or NO if it should not.
*/
- (BOOL)messagesInputToolbarAudioRecordingShouldStart:(QMInputToolbar *)toolbar
__deprecated_msg("Method deprecated. Use audioRecordingShouldStart");

/**
This method is called when an audio recording has started.
@param toolbar An instance of `QMInputToolbar`
*/
- (void)messagesInputToolbarAudioRecordingStart:(QMInputToolbar *)toolbar
__deprecated_msg("Method deprecated. Use audioRecordingStart");

/**
This method is called when an audio recording has cancelled.
@param toolbar An instance of `QMInputToolbar`
*/
- (void)messagesInputToolbarAudioRecordingCancel:(QMInputToolbar *)toolbar
__deprecated_msg("Method deprecated. Use audioRecordingCancel");

/**
This method is called when an audio recording has completed.
@param toolbar An instance of `QMInputToolbar`
*/
- (void)messagesInputToolbarAudioRecordingComplete:(QMInputToolbar *)toolbar
__deprecated_msg("Method deprecated. Use audioRecordingComplete");

/**
This method is called when an audio recording has paused because of timeout.
@discussion: This mehod will be called only if 'inputPanelAudioRecordingMaximumDuration:' is adopted.
@param toolbar An instance of `QMInputToolbar`.
*/
- (void)messagesInputToolbarAudioRecordingPausedByTimeOut:(QMInputToolbar *)toolbar
__deprecated_msg("Method deprecated. Use audioRecordingPausedByTimeOut");

/**
Tells the delegate to return the current duration.
@param toolbar An instance of `QMInputToolbar`
@return Current duration of the audio recorder.
*/
- (NSTimeInterval)inputPanelAudioRecordingDuration:(QMInputToolbar *)toolbar
__deprecated_msg("Method deprecated. Use audioRecordingDuration:");

/**
Tells the delegate to return the maximum duration.
@param toolbar An instance of `QMInputToolbar`
@return The maximum duration of the recorded audio.
*/
- (NSTimeInterval)inputPanelAudioRecordingMaximumDuration:(QMInputToolbar *)toolbar
__deprecated_msg("Method deprecated. Use audioRecordingMaximumDuration:");

@end

/**
Expand Down Expand Up @@ -223,7 +162,7 @@ __deprecated_msg("Method deprecated. Use audioRecordingMaximumDuration:");
@property (assign, nonatomic) BOOL audioRecordingEnabled;

/**
Cancels current audio recording and calls the delegate method 'messagesInputToolbarAudioRecordingCancel:'
Cancels current audio recording and calls the delegate method 'audioRecordingCancel:'
*/
- (void)cancelAudioRecording;

Expand Down
50 changes: 7 additions & 43 deletions QMChatViewController/Views/CustomUI/InputToolBar/QMInputToolbar.m
Original file line number Diff line number Diff line change
Expand Up @@ -317,30 +317,16 @@ - (void)finishAudioRecording {
}

- (void)recordButtonInteractionDidBegin {

dispatch_block_t startRecording = ^{

self.recording = YES;
[self setShowRecordingInterface:true velocity:0.0f];
if ([self.delegate respondsToSelector:@selector(messagesInputToolbarAudioRecordingStart:)]) {
[self.delegate messagesInputToolbarAudioRecordingStart:self];
}

if ([self.audioRecordDelegate respondsToSelector:@selector(audioRecordingStart:)]) {
[self.audioRecordDelegate audioRecordingStart:self];
}
[self startAudioRecording];
};

if ([self.delegate respondsToSelector:@selector(messagesInputToolbarAudioRecordingShouldStart:)]) {
if ([self.delegate messagesInputToolbarAudioRecordingShouldStart:self]) {
startRecording();
}
}

if ([self.audioRecordDelegate respondsToSelector:@selector(audioRecordingShouldStart:)]) {
if ([self.audioRecordDelegate audioRecordingShouldStart:self]) {
startRecording();
self.recording = YES;
[self setShowRecordingInterface:true velocity:0.0f];

if ([self.audioRecordDelegate respondsToSelector:@selector(audioRecordingStart:)]) {
[self.audioRecordDelegate audioRecordingStart:self];
}
[self startAudioRecording];
}
}
}
Expand All @@ -352,9 +338,6 @@ - (void)recordButtonInteractionDidCancel:(CGFloat)velocity {
self.recording = NO;
[self setShowRecordingInterface:false velocity:velocity];

if ([self.delegate respondsToSelector:@selector(messagesInputToolbarAudioRecordingCancel:)]) {
[self.delegate messagesInputToolbarAudioRecordingCancel:self];
}
if ([self.audioRecordDelegate respondsToSelector:@selector(audioRecordingCancel:)]) {
[self.audioRecordDelegate audioRecordingCancel:self];
}
Expand All @@ -368,9 +351,6 @@ - (void)cancelAudioRecording {

[self setShowRecordingInterface:false velocity:0.0];

if ([self.delegate respondsToSelector:@selector(messagesInputToolbarAudioRecordingCancel:)]) {
[self.delegate messagesInputToolbarAudioRecordingCancel:self];
}
if ([self.audioRecordDelegate respondsToSelector:@selector(audioRecordingCancel:)]) {
[self.audioRecordDelegate audioRecordingCancel:self];
}
Expand All @@ -384,10 +364,6 @@ - (void)recordButtonInteractionDidComplete:(CGFloat)velocity {
self.recording = NO;
[self setShowRecordingInterface:false velocity:velocity];

if ([self.delegate respondsToSelector:@selector(messagesInputToolbarAudioRecordingComplete:)]) {
[self.delegate messagesInputToolbarAudioRecordingComplete:self];
}

if ([self.audioRecordDelegate respondsToSelector:@selector(audioRecordingComplete:)]) {
[self.audioRecordDelegate audioRecordingComplete:self];
}
Expand All @@ -414,21 +390,13 @@ - (void)shakeControls {

- (void)shouldStopRecordingByTimeOut {

if ([self.delegate respondsToSelector:@selector(messagesInputToolbarAudioRecordingPausedByTimeOut:)]) {
return [self.delegate messagesInputToolbarAudioRecordingPausedByTimeOut:self];
}

if ([self.audioRecordDelegate respondsToSelector:@selector(audioRecordingPausedByTimeOut:)]) {
return [self.audioRecordDelegate audioRecordingPausedByTimeOut:self];
}
}

- (NSTimeInterval)maximumDuration {

if ([self.delegate respondsToSelector:@selector(inputPanelAudioRecordingMaximumDuration:)]) {
return [self.delegate inputPanelAudioRecordingMaximumDuration:self];
}

if ([self.audioRecordDelegate respondsToSelector:@selector(audioRecordingMaximumDuration:)]) {
return [self.audioRecordDelegate audioRecordingMaximumDuration:self];
}
Expand All @@ -438,10 +406,6 @@ - (NSTimeInterval)maximumDuration {

- (NSTimeInterval)currentDuration {

if ([self.delegate respondsToSelector:@selector(inputPanelAudioRecordingDuration:)]) {
return [self.delegate inputPanelAudioRecordingDuration:self];
}

if ([self.audioRecordDelegate respondsToSelector:@selector(audioRecordingDuration:)]) {
return [self.audioRecordDelegate audioRecordingDuration:self];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ - (void)setShowRecordingInterface:(BOOL)show velocity:(CGFloat)velocity
int animationCurveOption = 7 << 16;

[UIView animateWithDuration:0.25 delay:0.06 options:animationCurveOption animations:^{
_recordIndicatorView.alpha = 1.0f;
_recordIndicatorView.transform = CGAffineTransformIdentity;
self.recordIndicatorView.alpha = 1.0f;
self.recordIndicatorView.transform = CGAffineTransformIdentity;
} completion:nil];

[UIView animateWithDuration:0.25 delay:0.0 options:animationCurveOption animations:^{
_recordDurationLabel.alpha = 1.0f;
_recordDurationLabel.transform = CGAffineTransformIdentity;
self.recordDurationLabel.alpha = 1.0f;
self.recordDurationLabel.transform = CGAffineTransformIdentity;
} completion:nil];

[UIView animateWithDuration:0.18
delay:0.04
options:animationCurveOption
animations:^{
_slideToCancelLabel.alpha = 1.0f;
_slideToCancelLabel.transform = CGAffineTransformIdentity;
self.slideToCancelLabel.alpha = 1.0f;
self.slideToCancelLabel.transform = CGAffineTransformIdentity;
} completion:nil];

[self addRecordingDotAnimation];
Expand All @@ -161,12 +161,12 @@ - (void)setShowRecordingInterface:(BOOL)show velocity:(CGFloat)velocity
options:options | animationCurveOption
animations:^{

_recordIndicatorView.alpha = 0.5f;
_recordIndicatorView.transform = CGAffineTransformMakeTranslation(-90.0f, 0.0f);
self.recordIndicatorView.alpha = 0.5f;
self.recordIndicatorView.transform = CGAffineTransformMakeTranslation(-90.0f, 0.0f);
}
completion:^(BOOL finished) {
if (finished){
[_recordIndicatorView removeFromSuperview];
[self.recordIndicatorView removeFromSuperview];
}
}];

Expand All @@ -175,13 +175,13 @@ - (void)setShowRecordingInterface:(BOOL)show velocity:(CGFloat)velocity
options:UIViewAnimationOptionBeginFromCurrentState | animationCurveOption
animations:^ {

_recordDurationLabel.alpha = 0.0f;
_recordDurationLabel.transform = CGAffineTransformMakeTranslation(-90.0f, 0.0f);
self.recordDurationLabel.alpha = 0.0f;
self.recordDurationLabel.transform = CGAffineTransformMakeTranslation(-90.0f, 0.0f);

} completion:^(BOOL finished) {

if (finished){
[_recordDurationLabel removeFromSuperview];
[self.recordDurationLabel removeFromSuperview];
}
}];

Expand All @@ -190,8 +190,8 @@ - (void)setShowRecordingInterface:(BOOL)show velocity:(CGFloat)velocity
options:UIViewAnimationOptionBeginFromCurrentState | animationCurveOption
animations:^ {

_slideToCancelLabel.alpha = 0.0f;
_slideToCancelLabel.transform = CGAffineTransformMakeTranslation(-200, 0.0f);
self.slideToCancelLabel.alpha = 0.0f;
self.slideToCancelLabel.transform = CGAffineTransformMakeTranslation(-200, 0.0f);
} completion:nil];
}
}
Expand Down Expand Up @@ -286,7 +286,7 @@ - (void)showErrorMessage:(NSString *)errorMessage completion:(dispatch_block_t)c

[UIView animateWithDuration:0.25 delay:0.06 options:0 animations:^{

_errorMessageLabel.alpha = 1.0f;
self.errorMessageLabel.alpha = 1.0f;

} completion:^(BOOL finished) {

Expand Down
8 changes: 4 additions & 4 deletions QMChatViewController/Views/CustomUI/QMImageView/QMImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ - (void)setImageWithURL:(NSURL *)url

dispatch_block_t showPlaceholder = ^{

[_textLayer setString:title color:[self colorForString:title]];
_textLayer.hidden = NO;
[self.textLayer setString:title color:[self colorForString:title]];
self.textLayer.hidden = NO;

if (!CGRectEqualToRect(_textLayer.frame, self.bounds)) {
_textLayer.frame = self.bounds;
if (!CGRectEqualToRect(self.textLayer.frame, self.bounds)) {
self.textLayer.frame = self.bounds;
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

0 comments on commit e07a64b

Please sign in to comment.