From 4bd5c12f73dda9159193de53598091c9b6c902a2 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 7 Feb 2022 14:26:47 +0200 Subject: [PATCH] Fixed various project warnings. Completely disabled nullability checks, went down from ~20k to 195. --- .swiftlint.yml | 2 +- Config/BuildSettings.swift | 2 - Config/Project-Warnings.xcconfig | 4 + Podfile | 7 +- Riot/Assets/Base.lproj/Main.storyboard | 48 +-- Riot/Managers/BugReport/RageShakeManager.m | 2 +- .../PushNotificationService.h | 1 - Riot/Managers/Widgets/WidgetManager.m | 4 +- Riot/Modules/Application/LegacyAppDelegate.m | 78 ++--- .../AuthenticationViewController.h | 1 - .../Authentication/Views/AuthInputsView.m | 30 +- .../Views/ForgotPasswordInputsView.m | 2 +- Riot/Modules/Call/CallViewController.m | 4 +- Riot/Modules/Call/Views/IncomingCallView.h | 3 - .../CustomSizedPresentationController.swift | 2 +- .../Common/Recents/RecentsViewController.m | 12 +- .../SegmentedViewController.m | 3 + .../Home/GroupHomeViewController.h | 3 - .../Home/GroupHomeViewController.m | 33 ++- .../Members/GroupParticipantsViewController.h | 3 - .../Members/GroupParticipantsViewController.m | 19 +- .../Rooms/GroupRoomsViewController.h | 3 - .../Rooms/GroupRoomsViewController.m | 7 +- .../TabDetail/GroupDetailsViewController.h | 3 - .../Details/ContactDetailsViewController.m | 4 +- .../UnifiedSearchRecentsDataSource.m | 12 - .../UnifiedSearchViewController.m | 8 +- .../Fallback/AuthFallBackViewController.m | 2 +- .../WidgetPermissionViewController.swift | 2 - ...SuccessFromRecoveryKeyViewController.swift | 2 +- .../MajorUpdateViewController.swift | 2 - .../MXKAttachmentsViewController.m | 4 + .../MXKAuthenticationViewController.m | 3 + .../MXKCountryPickerViewController.m | 2 +- .../Controllers/MXKGroupListViewController.m | 6 + .../MXKLanguagePickerViewController.m | 2 +- .../Controllers/MXKRecentListViewController.m | 6 + .../MXKRoomMemberListViewController.m | 6 + .../Controllers/MXKSearchViewController.m | 6 + .../Controllers/MXKWebViewViewController.m | 4 + .../Modules/MatrixKit/Libs/SwiftUTI/UTI.swift | 276 +++++++++--------- Riot/Modules/MatrixKit/MatrixKit.h | 1 - .../Models/Account/MXKAccountManager.m | 9 + .../MatrixKit/Models/Contact/MXKContact.h | 3 + .../MatrixKit/Models/Contact/MXKContact.m | 3 + .../Models/Contact/MXKContactManager.m | 8 + .../Modules/MatrixKit/Models/MXKAppSettings.m | 3 + .../RoomList/MXKSessionRecentsDataSource.h | 2 +- Riot/Modules/MatrixKit/Utils/MXKConstants.h | 3 - .../Utils/MXKDocumentPickerPresenter.swift | 3 +- Riot/Modules/MatrixKit/Utils/MXKTools.m | 2 +- Riot/Modules/MatrixKit/Utils/MXKUTI.swift | 10 +- .../MXKAuthenticationFallbackWebView.m | 2 +- .../MXKAuthenticationRecaptchaWebView.m | 2 +- .../MXKEncryptionInfoView.m | 4 +- ...MXKRoomInputToolbarViewWithHPGrowingText.h | 33 --- ...MXKRoomInputToolbarViewWithHPGrowingText.m | 187 ------------ ...KRoomInputToolbarViewWithHPGrowingText.xib | 85 ------ ...OnboardingCoordinatorBridgePresenter.swift | 3 +- ...ditHistoryCoordinatorBridgePresenter.swift | 1 - .../EmojiPickerViewController.swift | 2 +- Riot/Modules/Room/MXKRoomViewController.m | 15 +- .../Members/RoomParticipantsViewController.m | 5 +- .../Room/RoomCoordinatorBridgePresenter.swift | 3 +- Riot/Modules/Room/RoomViewController.m | 19 +- .../Room/Search/RoomSearchViewController.m | 8 +- .../Views/Activities/RoomActivitiesView.m | 3 + .../Common/MXKRoomBubbleTableViewCell.m | 3 + .../RoomKeyRequestViewController.m | 6 +- ...SecretsRecoveryWithKeyViewController.swift | 2 +- ...RecoveryWithPassphraseViewController.swift | 2 +- .../Modules/Settings/SettingsViewController.m | 2 + .../SpaceDetailViewController.swift | 6 +- .../SpaceDetail/SpaceDetailViewModel.swift | 30 +- .../Spaces/SpaceList/SpaceListViewModel.swift | 12 +- ...aceMembersCoordinatorBridgePresenter.swift | 3 +- ...xploreRoomCoordinatorBridgePresenter.swift | 3 +- .../SpaceChildRoomDetailViewModel.swift | 6 +- .../SplitView/SplitViewCoordinator.swift | 9 +- Riot/Modules/TabBar/MasterTabBarController.m | 6 +- .../ThreadsCoordinatorBridgePresenter.swift | 3 +- .../UserDevices/UsersDevicesViewController.m | 4 +- Riot/Utils/EventFormatter.m | 2 +- RiotNSE/NotificationService.swift | 2 +- changelog.d/pr-5513.misc | 1 + 85 files changed, 465 insertions(+), 679 deletions(-) delete mode 100644 Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.h delete mode 100644 Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.m delete mode 100644 Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.xib create mode 100644 changelog.d/pr-5513.misc diff --git a/.swiftlint.yml b/.swiftlint.yml index 4d215eb98..f210c1ac3 100755 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -36,7 +36,7 @@ line_length: error: 1000 file_length: - warning: 700 + warning: 800 error: 1000 type_body_length: diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index 305f4dddc..0996ce2ef 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -146,8 +146,6 @@ final class BuildSettings: NSObject { static let stunServerFallbackUrlString: String? = "stun:turn.matrix.org" // MARK: - Public rooms Directory - #warning("Unused build setting: should this be implemented in ShowDirectory?") - static let publicRoomsAllowServerChange: Bool = true // List of homeservers for the public rooms directory static let publicRoomsDirectoryServers = [ "matrix.org", diff --git a/Config/Project-Warnings.xcconfig b/Config/Project-Warnings.xcconfig index 8c9512128..350f6dd29 100644 --- a/Config/Project-Warnings.xcconfig +++ b/Config/Project-Warnings.xcconfig @@ -46,3 +46,7 @@ GCC_WARN_UNDECLARED_SELECTOR = YES GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE GCC_WARN_UNUSED_FUNCTION = YES GCC_WARN_UNUSED_VARIABLE = YES + +WARNING_CFLAGS = $(inherited) -Wno-nullability-completeness; +OTHER_SWIFT_FLAGS = $(inherited) -Xcc -Wno-nullability-completeness + diff --git a/Podfile b/Podfile index c98ddb10c..09f7811c9 100644 --- a/Podfile +++ b/Podfile @@ -49,7 +49,6 @@ end ######################################## def import_MatrixKit_pods - pod 'HPGrowingTextView', '~> 1.1' pod 'libPhoneNumber-iOS', '~> 0.9.13' pod 'DTCoreText', '~> 1.6.25' #pod 'DTCoreText/Extension', '~> 1.6.25' @@ -98,7 +97,7 @@ abstract_target 'RiotPods' do pod 'DSWaveformImage', '~> 6.1.1' pod 'ffmpeg-kit-ios-audio', '4.5.1' - pod 'FLEX', '~> 4.5.0', :configurations => ['Debug'] + pod 'FLEX', '~> 4.5.0', :configurations => ['Debug'], :inhibit_warnings => true target 'RiotTests' do inherit! :search_paths @@ -149,6 +148,10 @@ post_install do |installer| # Stop Xcode 12 complaining about old IPHONEOS_DEPLOYMENT_TARGET from pods config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' + + # Disable nullability checks + config.build_settings['WARNING_CFLAGS'] ||= ['$(inherited)','-Wno-nullability-completeness'] + config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['$(inherited)', '-Xcc', '-Wno-nullability-completeness'] end end end \ No newline at end of file diff --git a/Riot/Assets/Base.lproj/Main.storyboard b/Riot/Assets/Base.lproj/Main.storyboard index 4708d7dbc..885be7db7 100644 --- a/Riot/Assets/Base.lproj/Main.storyboard +++ b/Riot/Assets/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -46,24 +46,6 @@ - - - - - - - - - - - - - - - - - - @@ -116,14 +98,6 @@ - - - - - - - - @@ -501,24 +475,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/Riot/Managers/BugReport/RageShakeManager.m b/Riot/Managers/BugReport/RageShakeManager.m index 4ce848240..5f04baa9e 100644 --- a/Riot/Managers/BugReport/RageShakeManager.m +++ b/Riot/Managers/BugReport/RageShakeManager.m @@ -200,7 +200,7 @@ static RageShakeManager* sharedInstance = nil; UIImage *image; - AppDelegate* theDelegate = [AppDelegate theDelegate]; + LegacyAppDelegate* theDelegate = [AppDelegate theDelegate]; UIGraphicsBeginImageContextWithOptions(theDelegate.window.bounds.size, NO, [UIScreen mainScreen].scale); // Iterate over every window from back to front diff --git a/Riot/Managers/PushNotification/PushNotificationService.h b/Riot/Managers/PushNotification/PushNotificationService.h index aaec583d7..c16b65792 100644 --- a/Riot/Managers/PushNotification/PushNotificationService.h +++ b/Riot/Managers/PushNotification/PushNotificationService.h @@ -108,7 +108,6 @@ NS_ASSUME_NONNULL_BEGIN @param pushNotificationService PushNotificationService object. @param roomId Room identifier to be navigated. - @param eventId Event identifier to be navigated around. */ - (void)pushNotificationService:(PushNotificationService *)pushNotificationService shouldNavigateToRoomWithId:(NSString *)roomId; diff --git a/Riot/Managers/Widgets/WidgetManager.m b/Riot/Managers/Widgets/WidgetManager.m index 2b25d2e13..240d573c1 100644 --- a/Riot/Managers/Widgets/WidgetManager.m +++ b/Riot/Managers/Widgets/WidgetManager.m @@ -338,7 +338,6 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain"; Check user's power for widgets management in a room. @param room the room to check. - @return an NSError if the user cannot act on widgets in this room. Else, nil. */ - (void)checkWidgetPermissionInRoom:(MXRoom *)room success:(dispatch_block_t)success failure:(void (^)(NSError *))failure { @@ -742,6 +741,8 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain"; return configs[mxSession.myUser.userId].scalarToken; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)loadConfigs { NSUserDefaults *userDefaults = [MXKAppSettings standardAppSettings].sharedUserDefaults; @@ -787,6 +788,7 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain"; [userDefaults setObject:[NSKeyedArchiver archivedDataWithRootObject:configs] forKey:@"integrationManagerConfigs"]; } +#pragma clang diagnostic pop #pragma mark - Errors diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index a462a4bc0..6fe61c3b1 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -838,28 +838,28 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni } // Enable error notifications - isErrorNotificationSuspended = NO; + self->isErrorNotificationSuspended = NO; - if (noCallSupportAlert) + if (self->noCallSupportAlert) { MXLogDebug(@"[AppDelegate] restoreInitialDisplay: keep visible noCall support alert"); - [self showNotificationAlert:noCallSupportAlert]; + [self showNotificationAlert:self->noCallSupportAlert]; } - else if (cryptoDataCorruptedAlert) + else if (self->cryptoDataCorruptedAlert) { MXLogDebug(@"[AppDelegate] restoreInitialDisplay: keep visible log in again"); - [self showNotificationAlert:cryptoDataCorruptedAlert]; + [self showNotificationAlert:self->cryptoDataCorruptedAlert]; } - else if (wrongBackupVersionAlert) + else if (self->wrongBackupVersionAlert) { MXLogDebug(@"[AppDelegate] restoreInitialDisplay: keep visible wrongBackupVersionAlert"); - [self showNotificationAlert:wrongBackupVersionAlert]; + [self showNotificationAlert:self->wrongBackupVersionAlert]; } // Check whether an error notification is pending - else if (_errorNotification) + else if (self->_errorNotification) { - [self showNotificationAlert:_errorNotification]; + [self showNotificationAlert:self->_errorNotification]; } }]; @@ -876,10 +876,10 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni } // Enable error notification (Check whether a notification is pending) - isErrorNotificationSuspended = NO; - if (_errorNotification) + self->isErrorNotificationSuspended = NO; + if (self->_errorNotification) { - [self showNotificationAlert:_errorNotification]; + [self showNotificationAlert:self->_errorNotification]; } }]; } @@ -1429,9 +1429,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni else { void(^findRoom)(void) = ^{ - if ([_masterTabBarController.selectedViewController conformsToProtocol:@protocol(MXKViewControllerActivityHandling)]) + if ([self->_masterTabBarController.selectedViewController conformsToProtocol:@protocol(MXKViewControllerActivityHandling)]) { - UIViewController *homeViewController = (UIViewController*)_masterTabBarController.selectedViewController; + UIViewController *homeViewController = (UIViewController*)self->_masterTabBarController.selectedViewController; [homeViewController startActivityIndicator]; @@ -1439,7 +1439,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni { // The alias may be not part of user's rooms states // Ask the HS to resolve the room alias into a room id and then retry - universalLinkFragmentPending = fragment; + self->universalLinkFragmentPending = fragment; MXKAccount* account = accountManager.activeAccounts.firstObject; [account.mxSession.matrixRestClient roomIDForRoomAlias:roomIdOrAlias success:^(NSString *roomId) { @@ -1447,7 +1447,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni [homeViewController stopActivityIndicator]; // Check that 'fragment' has not been cancelled - if ([universalLinkFragmentPending isEqualToString:fragment]) + if ([self->universalLinkFragmentPending isEqualToString:fragment]) { // Retry opening the link but with the returned room id NSString *newUniversalLinkFragment = @@ -1467,7 +1467,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni if (![newUniversalLinkFragment isEqualToString:fragment]) { - universalLinkFragmentPendingRoomAlias = @{roomId: roomIdOrAlias}; + self->universalLinkFragmentPendingRoomAlias = @{roomId: roomIdOrAlias}; UniversalLinkParameters *newParameters = [[UniversalLinkParameters alloc] initWithFragment:newUniversalLinkFragment universalLinkURL:universalLinkURL presentationParameters:presentationParameters]; @@ -1498,12 +1498,12 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni MXKAccount* account = accountManager.activeAccounts.firstObject; MXLogDebug(@"[AppDelegate] Universal link: Need to wait for the session to be sync'ed and running"); - universalLinkFragmentPending = fragment; + self->universalLinkFragmentPending = fragment; - universalLinkWaitingObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXSessionStateDidChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull notif) { + self->universalLinkWaitingObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXSessionStateDidChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull notif) { // Check that 'fragment' has not been cancelled - if ([universalLinkFragmentPending isEqualToString:fragment]) + if ([self->universalLinkFragmentPending isEqualToString:fragment]) { // Check whether the concerned session is the associated one if (notif.object == account.mxSession && account.mxSession.state == MXSessionStateRunning) @@ -1582,7 +1582,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni universalLinkWaitingObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKAccountManagerDidAddAccountNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { // Check that 'fragment' has not been cancelled - if ([universalLinkFragmentPending isEqualToString:fragment]) + if ([self->universalLinkFragmentPending isEqualToString:fragment]) { MXLogDebug(@"[AppDelegate] Universal link: The user is now logged in. Retry the link"); [self handleUniversalLinkWithParameters:universalLinkParameters]; @@ -1647,7 +1647,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni universalLinkWaitingObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKAccountManagerDidAddAccountNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { // Check that 'fragment' has not been cancelled - if ([universalLinkFragmentPending isEqualToString:fragment]) + if ([self->universalLinkFragmentPending isEqualToString:fragment]) { MXLogDebug(@"[AppDelegate] Universal link: The user is now logged in. Retry the link"); [self handleUniversalLinkWithParameters:universalLinkParameters]; @@ -2319,7 +2319,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni } // Return to authentication screen - [_masterTabBarController showOnboardingFlow]; + [self->_masterTabBarController showOnboardingFlow]; // Note: Keep App settings // But enforce usage of member lazy loading @@ -2730,7 +2730,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni if ([[ruleAction.parameters valueForKey:@"set_tweak"] isEqualToString:@"sound"]) { // Play message sound - AudioServicesPlaySystemSound(_messageSound); + AudioServicesPlaySystemSound(self->_messageSound); } } } @@ -3425,9 +3425,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni { case MXEventTypeCallInvite: { - if (noCallSupportAlert) + if (self->noCallSupportAlert) { - [noCallSupportAlert dismissViewControllerAnimated:NO completion:nil]; + [self->noCallSupportAlert dismissViewControllerAnimated:NO completion:nil]; } MXCallInviteEventContent *callInviteEventContent = [MXCallInviteEventContent modelFromJSON:event.content]; @@ -3449,15 +3449,15 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni NSString *message = [VectorL10n noVoip:callerDisplayname :appDisplayName]; - noCallSupportAlert = [UIAlertController alertControllerWithTitle:[VectorL10n noVoipTitle] - message:message - preferredStyle:UIAlertControllerStyleAlert]; + self->noCallSupportAlert = [UIAlertController alertControllerWithTitle:[VectorL10n noVoipTitle] + message:message + preferredStyle:UIAlertControllerStyleAlert]; __weak typeof(self) weakSelf = self; - [noCallSupportAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ignore] - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) { + [self->noCallSupportAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ignore] + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * action) { if (weakSelf) { @@ -3467,9 +3467,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni }]]; - [noCallSupportAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n rejectCall] - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) { + [self->noCallSupportAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n rejectCall] + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * action) { // Reject the call by sending the hangup event NSDictionary *content = @{ @@ -3490,7 +3490,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni }]]; - [self showNotificationAlert:noCallSupportAlert]; + [self showNotificationAlert:self->noCallSupportAlert]; break; } @@ -3498,10 +3498,10 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni case MXEventTypeCallHangup: case MXEventTypeCallReject: // The call has ended. The alert is no more needed. - if (noCallSupportAlert) + if (self->noCallSupportAlert) { - [noCallSupportAlert dismissViewControllerAnimated:YES completion:nil]; - noCallSupportAlert = nil; + [self->noCallSupportAlert dismissViewControllerAnimated:YES completion:nil]; + self->noCallSupportAlert = nil; } break; diff --git a/Riot/Modules/Authentication/AuthenticationViewController.h b/Riot/Modules/Authentication/AuthenticationViewController.h index 894ea8b45..1f6b278d0 100644 --- a/Riot/Modules/Authentication/AuthenticationViewController.h +++ b/Riot/Modules/Authentication/AuthenticationViewController.h @@ -37,7 +37,6 @@ @property (weak, nonatomic) IBOutlet UIButton *customServersTickButton; @property (weak, nonatomic) IBOutlet UIView *customServersContainer; @property (weak, nonatomic) IBOutlet UIView *homeServerContainer; -@property (weak, nonatomic) IBOutlet UIView *identityServerContainer; @property (weak, nonatomic) IBOutlet UIView *homeServerSeparator; @property (weak, nonatomic) IBOutlet UIView *identityServerSeparator; diff --git a/Riot/Modules/Authentication/Views/AuthInputsView.m b/Riot/Modules/Authentication/Views/AuthInputsView.m index 43efbce8b..b4eaad74a 100644 --- a/Riot/Modules/Authentication/Views/AuthInputsView.m +++ b/Riot/Modules/Authentication/Views/AuthInputsView.m @@ -431,7 +431,7 @@ style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { - inputsAlert = nil; + self->inputsAlert = nil; }]]; @@ -551,10 +551,10 @@ } // Check whether a second 3pid is available - _isThirdPartyIdentifierPending = (!self.emailContainer.isHidden && self.emailTextField.text.length && ![self isFlowCompleted:kMXLoginFlowTypeEmailIdentity]); + self->_isThirdPartyIdentifierPending = (!self.emailContainer.isHidden && self.emailTextField.text.length && ![self isFlowCompleted:kMXLoginFlowTypeEmailIdentity]); // Launch msisdn validation - NSString *e164 = [[NBPhoneNumberUtil sharedInstance] format:nbPhoneNumber numberFormat:NBEPhoneNumberFormatE164 error:nil]; + NSString *e164 = [[NBPhoneNumberUtil sharedInstance] format:self->nbPhoneNumber numberFormat:NBEPhoneNumberFormatE164 error:nil]; NSString *msisdn; if ([e164 hasPrefix:@"+"]) { @@ -564,12 +564,12 @@ { msisdn = [e164 substringFromIndex:2]; } - submittedMSISDN = [[MXK3PID alloc] initWithMedium:kMX3PIDMediumMSISDN andAddress:msisdn]; - - [submittedMSISDN requestValidationTokenWithMatrixRestClient:restClient - isDuringRegistration:YES - nextLink:nil - success:^ + self->submittedMSISDN = [[MXK3PID alloc] initWithMedium:kMX3PIDMediumMSISDN andAddress:msisdn]; + + [self->submittedMSISDN requestValidationTokenWithMatrixRestClient:restClient + isDuringRegistration:YES + nextLink:nil + success:^ { [self showValidationMSISDNDialogToPrepareParameters:callback]; @@ -763,7 +763,7 @@ { NSDictionary *parameters = @{ @"auth": @{ - @"session":currentSession.session, + @"session": self->currentSession.session, @"response": response, @"type": kMXLoginFlowTypeRecaptcha }, @@ -870,7 +870,7 @@ { // We finalize here a registration triggered from external inputs. All the required data are handled by the session id NSDictionary *parameters = @{ - @"auth": @{@"session": currentSession.session, @"response": response, @"type": kMXLoginFlowTypeRecaptcha}, + @"auth": @{@"session": self->currentSession.session, @"response": response, @"type": kMXLoginFlowTypeRecaptcha}, }; callback (parameters, nil); } @@ -1705,7 +1705,7 @@ if (weakSelf) { typeof(self) self = weakSelf; - UITextField *textField = [inputsAlert textFields].firstObject; + UITextField *textField = [self->inputsAlert textFields].firstObject; NSString *smsCode = textField.text; self->inputsAlert = nil; @@ -1776,9 +1776,9 @@ self->inputsAlert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert]; - [inputsAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok] - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) { + [self->inputsAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok] + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * action) { if (weakSelf) { diff --git a/Riot/Modules/Authentication/Views/ForgotPasswordInputsView.m b/Riot/Modules/Authentication/Views/ForgotPasswordInputsView.m index 9173043f7..386df8331 100644 --- a/Riot/Modules/Authentication/Views/ForgotPasswordInputsView.m +++ b/Riot/Modules/Authentication/Views/ForgotPasswordInputsView.m @@ -219,7 +219,7 @@ style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { - inputsAlert = nil; + self->inputsAlert = nil; }]]; diff --git a/Riot/Modules/Call/CallViewController.m b/Riot/Modules/Call/CallViewController.m index 8ec636401..8f9eab5a1 100644 --- a/Riot/Modules/Call/CallViewController.m +++ b/Riot/Modules/Call/CallViewController.m @@ -721,7 +721,9 @@ CallAudioRouteMenuViewDelegate> { MXWeakify(self); [self.mainSession.callManager getThirdPartyUserFrom:phoneNumber success:^(MXThirdPartyUserInstance * _Nonnull user) { - MXStrongifyAndReturnIfNil(self); + if (weakself == nil) { + return; + } continueBlock(user.userId); } failure:^(NSError * _Nullable error) { diff --git a/Riot/Modules/Call/Views/IncomingCallView.h b/Riot/Modules/Call/Views/IncomingCallView.h index 3035aebb2..45f897115 100644 --- a/Riot/Modules/Call/Views/IncomingCallView.h +++ b/Riot/Modules/Call/Views/IncomingCallView.h @@ -43,9 +43,6 @@ typedef void (^IncomingCallViewAction)(void); @param mxcAvatarURI the Matrix Content URI of the caller avatar. @param mediaManager the media manager used to download this avatar if it is not cached yet. - @param placeholderImage - @param callerName - @param callInfo */ - (instancetype)initWithCallerAvatar:(NSString *)mxcAvatarURI mediaManager:(MXMediaManager *)mediaManager diff --git a/Riot/Modules/Common/Presentation/CustomSizedPresentationController.swift b/Riot/Modules/Common/Presentation/CustomSizedPresentationController.swift index 554705d73..7c7dfb47d 100644 --- a/Riot/Modules/Common/Presentation/CustomSizedPresentationController.swift +++ b/Riot/Modules/Common/Presentation/CustomSizedPresentationController.swift @@ -86,7 +86,7 @@ class CustomSizedPresentationController: UIPresentationController { // effect calls for only the top two corners to be rounded we size // the view such that the bottom CORNER_RADIUS points lie below // the bottom edge of the screen. - let cornerViewRect = presentationWrapperView.bounds//.inset(by: UIEdgeInsets(top: 0, left: 0, bottom: -cornerRadius, right: 0)) + let cornerViewRect = presentationWrapperView.bounds// .inset(by: UIEdgeInsets(top: 0, left: 0, bottom: -cornerRadius, right: 0)) let presentationRoundedCornerView = UIView(frame: cornerViewRect) presentationRoundedCornerView.autoresizingMask = [.flexibleWidth, .flexibleHeight] diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index 0aa137a5a..bbf442a53 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -35,7 +35,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewControllerDataReadyNotification"; -@interface RecentsViewController () +@interface RecentsViewController () { // Tell whether a recents refresh is pending (suspended during editing mode). BOOL isRefreshPending; @@ -1292,7 +1292,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro [self stopActivityIndicator]; // Leave editing mode - [self cancelEditionMode:isRefreshPending]; + [self cancelEditionMode:self->isRefreshPending]; } }]; @@ -1300,7 +1300,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro else { // Leave editing mode - [self cancelEditionMode:isRefreshPending]; + [self cancelEditionMode:self->isRefreshPending]; } } @@ -1358,7 +1358,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro [self stopActivityIndicator]; // Leave editing mode - [self cancelEditionMode:isRefreshPending]; + [self cancelEditionMode:self->isRefreshPending]; } failure:^(NSError *error) { @@ -1366,7 +1366,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro [self stopActivityIndicator]; - MXLogDebug(@"[RecentsViewController] Failed to update direct tag of the room (%@)", editedRoomId); + MXLogDebug(@"[RecentsViewController] Failed to update direct tag of the room (%@)", self->editedRoomId); // Notify the end user NSString *userId = self.mainSession.myUser.userId; // TODO: handle multi-account @@ -1375,7 +1375,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro userInfo:userId ? @{kMXKErrorUserIdKey: userId} : nil]; // Leave editing mode - [self cancelEditionMode:isRefreshPending]; + [self cancelEditionMode:self->isRefreshPending]; }]; } diff --git a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m index 60547f8c5..883a9c416 100644 --- a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m +++ b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m @@ -165,6 +165,8 @@ // Adjust Top [NSLayoutConstraint deactivateConstraints:@[self.selectionContainerTopConstraint]]; + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" // it is not possible to define a constraint to the topLayoutGuide in the xib editor // so do it in the code .. self.selectionContainerTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide @@ -174,6 +176,7 @@ attribute:NSLayoutAttributeTop multiplier:1.0f constant:0.0f]; + #pragma clang diagnostic pop [NSLayoutConstraint activateConstraints:@[self.selectionContainerTopConstraint]]; diff --git a/Riot/Modules/Communities/Home/GroupHomeViewController.h b/Riot/Modules/Communities/Home/GroupHomeViewController.h index 69b2300da..510e1dfcc 100644 --- a/Riot/Modules/Communities/Home/GroupHomeViewController.h +++ b/Riot/Modules/Communities/Home/GroupHomeViewController.h @@ -63,9 +63,6 @@ /** Set the group for which the details are displayed. Provide the related matrix session. - - @param group - @param mxSession */ - (void)setGroup:(MXGroup*)group withMatrixSession:(MXSession*)mxSession; diff --git a/Riot/Modules/Communities/Home/GroupHomeViewController.m b/Riot/Modules/Communities/Home/GroupHomeViewController.m index 6e5d5d3b5..a5a48ebba 100644 --- a/Riot/Modules/Communities/Home/GroupHomeViewController.m +++ b/Riot/Modules/Communities/Home/GroupHomeViewController.m @@ -40,7 +40,7 @@ // The options used to load long description html content. NSDictionary *options; - NSString *groupLongDescription; + NSString *groupLongDescriptionString; // The current pushed view controller UIViewController *pushedViewController; @@ -229,25 +229,25 @@ // Indeed the group update notifications are triggered by the matrix session only for the user's groups. void (^success)(void) = ^void(void) { - [self refreshDisplayWithGroup:_group]; + [self refreshDisplayWithGroup:self->_group]; }; // Trigger a refresh on the group summary. - [self.mxSession updateGroupSummary:_group success:(isPreview ? success : nil) failure:^(NSError *error) { + [self.mxSession updateGroupSummary:self->_group success:(isPreview ? success : nil) failure:^(NSError *error) { - MXLogDebug(@"[GroupHomeViewController] viewWillAppear: group summary update failed %@", _group.groupId); + MXLogDebug(@"[GroupHomeViewController] viewWillAppear: group summary update failed %@", self->_group.groupId); }]; // Trigger a refresh on the group members (ignore here the invited users). - [self.mxSession updateGroupUsers:_group success:(isPreview ? success : nil) failure:^(NSError *error) { + [self.mxSession updateGroupUsers:self->_group success:(isPreview ? success : nil) failure:^(NSError *error) { - MXLogDebug(@"[GroupHomeViewController] viewWillAppear: group members update failed %@", _group.groupId); + MXLogDebug(@"[GroupHomeViewController] viewWillAppear: group members update failed %@", self->_group.groupId); }]; // Trigger a refresh on the group rooms. - [self.mxSession updateGroupRooms:_group success:(isPreview ? success : nil) failure:^(NSError *error) { + [self.mxSession updateGroupRooms:self->_group success:(isPreview ? success : nil) failure:^(NSError *error) { - MXLogDebug(@"[GroupHomeViewController] viewWillAppear: group rooms update failed %@", _group.groupId); + MXLogDebug(@"[GroupHomeViewController] viewWillAppear: group rooms update failed %@", self->_group.groupId); }]; } @@ -523,11 +523,11 @@ { if (_group.summary.profile.longDescription.length) { - groupLongDescription = _group.summary.profile.longDescription; + groupLongDescriptionString = _group.summary.profile.longDescription; } else { - groupLongDescription = nil; + groupLongDescriptionString = nil; } [self renderGroupLongDescription]; @@ -535,13 +535,13 @@ - (void)renderGroupLongDescription { - if (groupLongDescription) + if (groupLongDescriptionString) { // Using DTCoreText, which renders static string, helps to avoid code injection attacks // that could happen with the default HTML renderer of NSAttributedString which is a // webview. // The supplied options include a callback to sanitize html tags and load image data. - NSAttributedString *attributedString = [[NSAttributedString alloc] initWithHTMLData:[groupLongDescription dataUsingEncoding:NSUTF8StringEncoding] options:options documentAttributes:NULL]; + NSAttributedString *attributedString = [[NSAttributedString alloc] initWithHTMLData:[groupLongDescriptionString dataUsingEncoding:NSUTF8StringEncoding] options:options documentAttributes:NULL]; // Apply additional treatments NSInteger mxIdsBitMask = (MXKTOOLS_USER_IDENTIFIER_BITWISE | MXKTOOLS_ROOM_IDENTIFIER_BITWISE | MXKTOOLS_ROOM_ALIAS_BITWISE | MXKTOOLS_EVENT_IDENTIFIER_BITWISE | MXKTOOLS_GROUP_IDENTIFIER_BITWISE); @@ -694,12 +694,12 @@ self->currentRequest = nil; [self stopActivityIndicator]; - [self refreshDisplayWithGroup:[_mxSession groupWithGroupId:_group.groupId]]; + [self refreshDisplayWithGroup:[self->_mxSession groupWithGroupId:self->_group.groupId]]; } } failure:^(NSError *error) { - MXLogDebug(@"[GroupDetailsViewController] join group (%@) failed", _group.groupId); + MXLogDebug(@"[GroupDetailsViewController] join group (%@) failed", self->_group.groupId); if (weakSelf) { @@ -732,7 +732,7 @@ } failure:^(NSError *error) { - MXLogDebug(@"[GroupDetailsViewController] leave group (%@) failed", _group.groupId); + MXLogDebug(@"[GroupDetailsViewController] leave group (%@) failed", self->_group.groupId); if (weakSelf) { @@ -802,6 +802,8 @@ #pragma mark - UITextView delegate +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange { BOOL shouldInteractWithURL = YES; @@ -903,5 +905,6 @@ return shouldInteractWithURL; } +#pragma clang diagnostic pop @end diff --git a/Riot/Modules/Communities/Members/GroupParticipantsViewController.h b/Riot/Modules/Communities/Members/GroupParticipantsViewController.h index 83b862664..e5b4a9ba8 100644 --- a/Riot/Modules/Communities/Members/GroupParticipantsViewController.h +++ b/Riot/Modules/Communities/Members/GroupParticipantsViewController.h @@ -76,9 +76,6 @@ /** Set the group for which the details are displayed. Provide the related matrix session. - - @param group - @param mxSession */ - (void)setGroup:(MXGroup*)group withMatrixSession:(MXSession*)mxSession; diff --git a/Riot/Modules/Communities/Members/GroupParticipantsViewController.m b/Riot/Modules/Communities/Members/GroupParticipantsViewController.m index 9a87f6562..c78907883 100644 --- a/Riot/Modules/Communities/Members/GroupParticipantsViewController.m +++ b/Riot/Modules/Communities/Members/GroupParticipantsViewController.m @@ -93,6 +93,8 @@ // Adjust Top and Bottom constraints to take into account potential navBar and tabBar. [NSLayoutConstraint deactivateConstraints:@[_searchBarTopConstraint, _tableViewBottomConstraint]]; + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" _searchBarTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual @@ -108,6 +110,7 @@ attribute:NSLayoutAttributeBottom multiplier:1.0f constant:0.0f]; + #pragma clang diagnostic pop [NSLayoutConstraint activateConstraints:@[_searchBarTopConstraint, _tableViewBottomConstraint]]; @@ -239,18 +242,18 @@ // Indeed the group update notifications are triggered by the matrix session only for the user's groups. void (^success)(void) = ^void(void) { - [self refreshDisplayWithGroup:_group]; + [self refreshDisplayWithGroup:self->_group]; }; // Trigger a refresh on the group members and the invited users. [self.mxSession updateGroupUsers:_group success:(isPreview ? success : nil) failure:^(NSError *error) { - MXLogDebug(@"[GroupParticipantsViewController] viewWillAppear: group members update failed %@", _group.groupId); + MXLogDebug(@"[GroupParticipantsViewController] viewWillAppear: group members update failed %@", self->_group.groupId); }]; [self.mxSession updateGroupInvitedUsers:_group success:(isPreview ? success : nil) failure:^(NSError *error) { - MXLogDebug(@"[GroupParticipantsViewController] viewWillAppear: invited users update failed %@", _group.groupId); + MXLogDebug(@"[GroupParticipantsViewController] viewWillAppear: invited users update failed %@", self->_group.groupId); }]; } @@ -305,7 +308,7 @@ [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseIn animations:^{ - tableViewMaskLayer.bounds = newBounds; + self->tableViewMaskLayer.bounds = newBounds; } completion:^(BOOL finished){ @@ -421,7 +424,7 @@ [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseIn animations:^{ - addParticipantButtonImageViewBottomConstraint.constant = keyboardHeight + 9; + self->addParticipantButtonImageViewBottomConstraint.constant = keyboardHeight + 9; // Force to render the view [self.view layoutIfNeeded]; @@ -653,7 +656,7 @@ pendingMaskSpinnerView.alpha = 0; [UIView animateWithDuration:0.3 delay:0.3 options:UIViewAnimationOptionBeginFromCurrentState animations:^{ - pendingMaskSpinnerView.alpha = 1; + self->pendingMaskSpinnerView.alpha = 1; } completion:^(BOOL finished) { }]; @@ -1075,14 +1078,14 @@ self->currentAlert = nil; [self addPendingActionMask]; - [self.mxSession leaveGroup:_group.groupId success:^{ + [self.mxSession leaveGroup:self->_group.groupId success:^{ [self withdrawViewControllerAnimated:YES completion:nil]; } failure:^(NSError *error) { [self removePendingActionMask]; - MXLogDebug(@"[GroupParticipantsVC] Leave group %@ failed", _group.groupId); + MXLogDebug(@"[GroupParticipantsVC] Leave group %@ failed", self->_group.groupId); // Alert user [[AppDelegate theDelegate] showErrorAsAlert:error]; diff --git a/Riot/Modules/Communities/Rooms/GroupRoomsViewController.h b/Riot/Modules/Communities/Rooms/GroupRoomsViewController.h index 792865b96..fe0a504a7 100644 --- a/Riot/Modules/Communities/Rooms/GroupRoomsViewController.h +++ b/Riot/Modules/Communities/Rooms/GroupRoomsViewController.h @@ -63,9 +63,6 @@ /** Set the group for which the rooms are listed. Provide the related matrix session. - - @param group - @param mxSession */ - (void)setGroup:(MXGroup*)group withMatrixSession:(MXSession*)mxSession; diff --git a/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m b/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m index 855c46580..4f60c4970 100644 --- a/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m +++ b/Riot/Modules/Communities/Rooms/GroupRoomsViewController.m @@ -79,6 +79,8 @@ // Adjust Top and Bottom constraints to take into account potential navBar and tabBar. [NSLayoutConstraint deactivateConstraints:@[_searchBarTopConstraint, _tableViewBottomConstraint]]; + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" _searchBarTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual @@ -94,6 +96,7 @@ attribute:NSLayoutAttributeBottom multiplier:1.0f constant:0.0f]; + #pragma clang diagnostic pop [NSLayoutConstraint activateConstraints:@[_searchBarTopConstraint, _tableViewBottomConstraint]]; @@ -203,13 +206,13 @@ // Indeed the group update notifications are triggered by the matrix session only for the user's groups. void (^success)(void) = ^void(void) { - [self refreshDisplayWithGroup:_group]; + [self refreshDisplayWithGroup:self->_group]; }; // Trigger a refresh on the group rooms. [self.mxSession updateGroupRooms:_group success:(isPreview ? success : nil) failure:^(NSError *error) { - MXLogDebug(@"[GroupRoomsViewController] viewWillAppear: group rooms update failed %@", _group.groupId); + MXLogDebug(@"[GroupRoomsViewController] viewWillAppear: group rooms update failed %@", self->_group.groupId); }]; } diff --git a/Riot/Modules/Communities/TabDetail/GroupDetailsViewController.h b/Riot/Modules/Communities/TabDetail/GroupDetailsViewController.h index e228101d4..faaab6b94 100644 --- a/Riot/Modules/Communities/TabDetail/GroupDetailsViewController.h +++ b/Riot/Modules/Communities/TabDetail/GroupDetailsViewController.h @@ -40,9 +40,6 @@ /** Set the group for which the details are displayed. Provide the related matrix session. - - @param group - @param mxSession */ - (void)setGroup:(MXGroup*)group withMatrixSession:(MXSession*)mxSession; diff --git a/Riot/Modules/Contacts/Details/ContactDetailsViewController.m b/Riot/Modules/Contacts/Details/ContactDetailsViewController.m index be2fe5596..8527ba72c 100644 --- a/Riot/Modules/Contacts/Details/ContactDetailsViewController.m +++ b/Riot/Modules/Contacts/Details/ContactDetailsViewController.m @@ -1084,7 +1084,7 @@ MXRoomCreationParameters *roomCreationParameters = [MXRoomCreationParameters parametersForDirectRoomWithUser:matrixId]; roomCreationRequest = [self.mainSession createRoomWithParameters:roomCreationParameters success:^(MXRoom *room) { - roomCreationRequest = nil; + self->roomCreationRequest = nil; // Delay the call in order to be sure that the room is ready dispatch_async(dispatch_get_main_queue(), ^{ @@ -1096,7 +1096,7 @@ MXLogDebug(@"[ContactDetailsViewController] Create room failed"); - roomCreationRequest = nil; + self->roomCreationRequest = nil; [self removePendingActionMask]; diff --git a/Riot/Modules/GlobalSearch/DataSources/UnifiedSearchRecentsDataSource.m b/Riot/Modules/GlobalSearch/DataSources/UnifiedSearchRecentsDataSource.m index 59d169d7f..d22de6e55 100644 --- a/Riot/Modules/GlobalSearch/DataSources/UnifiedSearchRecentsDataSource.m +++ b/Riot/Modules/GlobalSearch/DataSources/UnifiedSearchRecentsDataSource.m @@ -35,18 +35,6 @@ @implementation UnifiedSearchRecentsDataSource -- (instancetype)init -{ - self = [super init]; - if (self) - { - searchedRoomIdOrAliasSection = -1; - - _hideRecents = NO; - } - return self; -} - #pragma mark - - (void)setPublicRoomsDirectoryDataSource:(PublicRoomsDirectoryDataSource *)publicRoomsDirectoryDataSource diff --git a/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m b/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m index 8c1956330..7c8d816db 100644 --- a/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m +++ b/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m @@ -482,8 +482,8 @@ // Do it asynchronously to give time to messagesSearchViewController to be set up // so that it can display its loading wheel dispatch_async(dispatch_get_main_queue(), ^{ - [messagesSearchDataSource searchMessages:self.searchBar.text force:NO]; - messagesSearchViewController.shouldScrollToBottomOnRefresh = YES; + [self->messagesSearchDataSource searchMessages:self.searchBar.text force:NO]; + self->messagesSearchViewController.shouldScrollToBottomOnRefresh = YES; }); } } @@ -499,8 +499,8 @@ // Do it asynchronously to give time to filesSearchViewController to be set up // so that it can display its loading wheel dispatch_async(dispatch_get_main_queue(), ^{ - [filesSearchDataSource searchMessages:self.searchBar.text force:NO]; - filesSearchViewController.shouldScrollToBottomOnRefresh = YES; + [self->filesSearchDataSource searchMessages:self.searchBar.text force:NO]; + self->filesSearchViewController.shouldScrollToBottomOnRefresh = YES; }); } } diff --git a/Riot/Modules/Home/Fallback/AuthFallBackViewController.m b/Riot/Modules/Home/Fallback/AuthFallBackViewController.m index 93a770610..50f7b5f5c 100644 --- a/Riot/Modules/Home/Fallback/AuthFallBackViewController.m +++ b/Riot/Modules/Home/Fallback/AuthFallBackViewController.m @@ -157,7 +157,7 @@ NSString *FallBackViewControllerJavascriptOnLogin = @"window.matrixLogin.onLogin if ([urlString hasPrefix:@"js:"]) { // Listen only to scheme of the JS-WKWebView bridge - NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; + NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; NSError *error; diff --git a/Riot/Modules/Integrations/WidgetPermission/WidgetPermissionViewController.swift b/Riot/Modules/Integrations/WidgetPermission/WidgetPermissionViewController.swift index 2bb3a48bd..fbee5bb4b 100644 --- a/Riot/Modules/Integrations/WidgetPermission/WidgetPermissionViewController.swift +++ b/Riot/Modules/Integrations/WidgetPermission/WidgetPermissionViewController.swift @@ -218,8 +218,6 @@ extension WidgetPermissionViewController: SlidingModalPresentable { let widthConstraint = sizingViewContollerView.widthAnchor.constraint(equalToConstant: width) widthConstraint.isActive = true WidgetPermissionViewController.Sizing.widthConstraint = widthConstraint - - sizingViewContollerView.heightAnchor.constraint(equalToConstant: 0) } sizingViewContollerView.layoutIfNeeded() diff --git a/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromRecoveryKeyViewController.swift b/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromRecoveryKeyViewController.swift index 0c33c5915..fd2ab986a 100644 --- a/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromRecoveryKeyViewController.swift +++ b/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromRecoveryKeyViewController.swift @@ -143,7 +143,7 @@ final class KeyBackupSetupSuccessFromRecoveryKeyViewController: UIViewController private func shareRecoveryKey() { // Set up activity view controller - let activityItems: [Any] = [ self.recoveryKey ] + let activityItems: [Any] = [ self.recoveryKey as Any ] let activityViewController = UIActivityViewController(activityItems: activityItems, applicationActivities: nil) activityViewController.completionWithItemsHandler = { (activityType, completed, returnedItems, error) in diff --git a/Riot/Modules/MajorUpdate/MajorUpdateViewController.swift b/Riot/Modules/MajorUpdate/MajorUpdateViewController.swift index 0b57526ef..e10c7e715 100644 --- a/Riot/Modules/MajorUpdate/MajorUpdateViewController.swift +++ b/Riot/Modules/MajorUpdate/MajorUpdateViewController.swift @@ -165,8 +165,6 @@ extension MajorUpdateViewController: SlidingModalPresentable { let widthConstraint = sizingViewContollerView.widthAnchor.constraint(equalToConstant: width) widthConstraint.isActive = true MajorUpdateViewController.Sizing.widthConstraint = widthConstraint - - sizingViewContollerView.heightAnchor.constraint(equalToConstant: 0) } sizingViewContollerView.layoutIfNeeded() diff --git a/Riot/Modules/MatrixKit/Controllers/MXKAttachmentsViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKAttachmentsViewController.m index a21fbc396..06df81822 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKAttachmentsViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKAttachmentsViewController.m @@ -175,7 +175,11 @@ _attachmentsCollection.hidden = YES; // Display collection cell in full screen + + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" self.automaticallyAdjustsScrollViewInsets = NO; + #pragma clang diagnostic pop } - (BOOL)prefersStatusBarHidden diff --git a/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m index 3465c136b..34789e133 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m @@ -215,6 +215,8 @@ // and report the inputAccessoryView.superview of the firstResponder in self.keyboardView. } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)setKeyboardHeight:(CGFloat)keyboardHeight { // Deduce the bottom inset for the scroll view (Don't forget the potential tabBar) @@ -229,6 +231,7 @@ insets.bottom = scrollViewInsetBottom; self.authenticationScrollView.contentInset = insets; } +#pragma clang diagnostic pop - (void)destroy { diff --git a/Riot/Modules/MatrixKit/Controllers/MXKCountryPickerViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKCountryPickerViewController.m index 273046244..80ea288f7 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKCountryPickerViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKCountryPickerViewController.m @@ -152,7 +152,7 @@ NSString* const kMXKCountryPickerViewControllerCountryCellId = @"kMXKCountryPick { UISearchController *searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; - searchController.dimsBackgroundDuringPresentation = NO; + searchController.obscuresBackgroundDuringPresentation = NO; searchController.hidesNavigationBarDuringPresentation = NO; searchController.searchResultsUpdater = self; diff --git a/Riot/Modules/MatrixKit/Controllers/MXKGroupListViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKGroupListViewController.m index e9950fa3f..b23a55720 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKGroupListViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKGroupListViewController.m @@ -92,6 +92,8 @@ [[[self class] nib] instantiateWithOwner:self options:nil]; } + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" // Adjust search bar Top constraint to take into account potential navBar. if (_groupsSearchBarTopConstraint) { @@ -123,6 +125,7 @@ [NSLayoutConstraint activateConstraints:@[_groupsTableViewBottomConstraint]]; } + #pragma clang diagnostic pop // Hide search bar by default [self hideSearchBar:YES]; @@ -209,6 +212,8 @@ self.keyboardView = _groupsSearchBar.inputAccessoryView.superview; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)setKeyboardHeight:(CGFloat)keyboardHeight { // Deduce the bottom constraint for the table view (Don't forget the potential tabBar) @@ -225,6 +230,7 @@ // Force layout immediately to take into account new constraint [self.view layoutIfNeeded]; } +#pragma clang diagnostic pop - (void)destroy { diff --git a/Riot/Modules/MatrixKit/Controllers/MXKLanguagePickerViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKLanguagePickerViewController.m index 92d1a065c..b1c796356 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKLanguagePickerViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKLanguagePickerViewController.m @@ -160,7 +160,7 @@ NSString* const kMXKLanguagePickerCellDataKeyLanguage = @"language"; { UISearchController *searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; - searchController.dimsBackgroundDuringPresentation = NO; + searchController.obscuresBackgroundDuringPresentation = NO; searchController.hidesNavigationBarDuringPresentation = NO; searchController.searchResultsUpdater = self; diff --git a/Riot/Modules/MatrixKit/Controllers/MXKRecentListViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKRecentListViewController.m index 828f84825..86cb1dbfe 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKRecentListViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKRecentListViewController.m @@ -97,6 +97,8 @@ [[[self class] nib] instantiateWithOwner:self options:nil]; } + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" // Adjust search bar Top constraint to take into account potential navBar. if (_recentsSearchBarTopConstraint) { @@ -126,6 +128,7 @@ _recentsTableViewBottomConstraint.active = YES; } + #pragma clang diagnostic pop // Hide search bar by default [self hideSearchBar:YES]; @@ -229,6 +232,8 @@ self.keyboardView = _recentsSearchBar.inputAccessoryView.superview; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)setKeyboardHeight:(CGFloat)keyboardHeight { // Deduce the bottom constraint for the table view (Don't forget the potential tabBar) @@ -245,6 +250,7 @@ // Force layout immediately to take into account new constraint [self.view layoutIfNeeded]; } +#pragma clang diagnostic pop - (void)destroy { diff --git a/Riot/Modules/MatrixKit/Controllers/MXKRoomMemberListViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKRoomMemberListViewController.m index 217fb4758..f53ccc57a 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKRoomMemberListViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKRoomMemberListViewController.m @@ -105,6 +105,8 @@ // Adjust Top and Bottom constraints to take into account potential navBar and tabBar. [NSLayoutConstraint deactivateConstraints:@[_membersSearchBarTopConstraint, _membersTableViewBottomConstraint]]; + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" _membersSearchBarTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual @@ -120,6 +122,7 @@ attribute:NSLayoutAttributeBottom multiplier:1.0f constant:0.0f]; + #pragma clang diagnostic pop [NSLayoutConstraint activateConstraints:@[_membersSearchBarTopConstraint, _membersTableViewBottomConstraint]]; @@ -225,6 +228,8 @@ self.keyboardView = _membersSearchBar.inputAccessoryView.superview; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)setKeyboardHeight:(CGFloat)keyboardHeight { // Deduce the bottom constraint for the table view (Don't forget the potential tabBar) @@ -241,6 +246,7 @@ // Force layout immediately to take into account new constraint [self.view layoutIfNeeded]; } +#pragma clang diagnostic pop - (void)destroy { diff --git a/Riot/Modules/MatrixKit/Controllers/MXKSearchViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKSearchViewController.m index 7ac637b33..8d6a03b18 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKSearchViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKSearchViewController.m @@ -76,6 +76,8 @@ // Adjust Top and Bottom constraints to take into account potential navBar and tabBar. [NSLayoutConstraint deactivateConstraints:@[_searchSearchBarTopConstraint, _searchTableViewBottomConstraint]]; + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" _searchSearchBarTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual @@ -91,6 +93,7 @@ attribute:NSLayoutAttributeBottom multiplier:1.0f constant:0.0f]; + #pragma clang diagnostic pop [NSLayoutConstraint activateConstraints:@[_searchSearchBarTopConstraint, _searchTableViewBottomConstraint]]; @@ -140,6 +143,8 @@ self.keyboardView = _searchSearchBar.inputAccessoryView.superview; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)setKeyboardHeight:(CGFloat)keyboardHeight { // Deduce the bottom constraint for the table view (Don't forget the potential tabBar) @@ -156,6 +161,7 @@ // Force layout immediately to take into account new constraint [self.view layoutIfNeeded]; } +#pragma clang diagnostic pop - (void)destroy { diff --git a/Riot/Modules/MatrixKit/Controllers/MXKWebViewViewController.m b/Riot/Modules/MatrixKit/Controllers/MXKWebViewViewController.m index 07c23b452..b96fe3bd5 100644 --- a/Riot/Modules/MatrixKit/Controllers/MXKWebViewViewController.m +++ b/Riot/Modules/MatrixKit/Controllers/MXKWebViewViewController.m @@ -133,6 +133,9 @@ NSString *const kMXKWebViewViewControllerJavaScriptEnableLog = multiplier:1.0 constant:0]; // Force webview in full height + + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:webView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual @@ -147,6 +150,7 @@ NSString *const kMXKWebViewViewControllerJavaScriptEnableLog = attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; + #pragma clang diagnostic pop [NSLayoutConstraint activateConstraints:@[leftConstraint, rightConstraint, topConstraint, bottomConstraint]]; diff --git a/Riot/Modules/MatrixKit/Libs/SwiftUTI/UTI.swift b/Riot/Modules/MatrixKit/Libs/SwiftUTI/UTI.swift index c3d66c481..4ea8ea88d 100644 --- a/Riot/Modules/MatrixKit/Libs/SwiftUTI/UTI.swift +++ b/Riot/Modules/MatrixKit/Libs/SwiftUTI/UTI.swift @@ -104,7 +104,9 @@ public class UTI: RawRepresentable, Equatable { // UTTypeCreatePreferredIdentifierForTag only returns nil if the tag class is unknwown, which can't happen to us since we use an // enum of known values. Hence we can force-cast the result. + // swiftlint:disable force_unwrapping let identifier = (unmanagedIdentifier?.takeRetainedValue() as String?)! + // swiftlint:enable force_unwrapping self.init(rawValue: identifier) } @@ -122,7 +124,7 @@ public class UTI: RawRepresentable, Equatable { public convenience init(withExtension fileExtension: String, conformingTo conforming: UTI? = nil) { - self.init(withTagClass:.fileExtension, value: fileExtension, conformingTo: conforming) + self.init(withTagClass: .fileExtension, value: fileExtension, conformingTo: conforming) } /** @@ -138,7 +140,7 @@ public class UTI: RawRepresentable, Equatable { public convenience init(withMimeType mimeType: String, conformingTo conforming: UTI? = nil) { - self.init(withTagClass:.mimeType, value: mimeType, conformingTo: conforming) + self.init(withTagClass: .mimeType, value: mimeType, conformingTo: conforming) } #if os(macOS) @@ -146,7 +148,9 @@ public class UTI: RawRepresentable, Equatable { /** Initialize an UTI with a pasteboard type. - - Important: **This function is de-facto deprecated!** The old cocoa pasteboard types ( `NSStringPboardType`, `NSPDFPboardType`, etc) have been deprecated in favour of actual UTIs, and the constants are not available anymore in Swift. This function only works correctly with the values of these old constants, but _not_ with the replacement values (like `NSPasteboardTypeString` etc), since these already are UTIs. + - Important: **This function is de-facto deprecated!** The old cocoa pasteboard types ( `NSStringPboardType`, `NSPDFPboardType`, etc) have been deprecated in favour of actual UTIs, and the + constants are not available anymore in Swift. This function only works correctly with the values of these old constants, but _not_ with the replacement values (like `NSPasteboardTypeString` etc), since these + already are UTIs. - Parameters: - pbType: The pasteboard type (e.g. NSPDFPboardType). - conformingTo: If specified, the returned UTI must conform to this UTI. If nil is specified, this parameter is ignored. The default is nil. @@ -155,7 +159,7 @@ public class UTI: RawRepresentable, Equatable { */ public convenience init(withPBType pbType: String, conformingTo conforming: UTI? = nil) { - self.init(withTagClass:.pbType, value: pbType, conformingTo: conforming) + self.init(withTagClass: .pbType, value: pbType, conformingTo: conforming) } /** @@ -172,7 +176,7 @@ public class UTI: RawRepresentable, Equatable { public convenience init(withOSType osType: String, conformingTo conforming: UTI? = nil) { - self.init(withTagClass:.osType, value: osType, conformingTo: conforming) + self.init(withTagClass: .osType, value: osType, conformingTo: conforming) } #endif @@ -297,7 +301,7 @@ public class UTI: RawRepresentable, Equatable { return UTTypeConformsTo(self.rawCFValue, otherUTI.rawCFValue) as Bool } - public static func ==(lhs: UTI, rhs: UTI) -> Bool { + public static func == (lhs: UTI, rhs: UTI) -> Bool { return UTTypeEqual(lhs.rawCFValue, rhs.rawCFValue) as Bool } @@ -319,11 +323,11 @@ public class UTI: RawRepresentable, Equatable { /// Returns a uniform type’s declaration as a Dictionary, or nil if if no declaration for that type can be found. - public var declaration: [AnyHashable:Any]? { + public var declaration: [AnyHashable: Any]? { let unmanagedDeclaration = UTTypeCopyDeclaration(self.rawCFValue) - guard let declaration = unmanagedDeclaration?.takeRetainedValue() as? [AnyHashable:Any] else { + guard let declaration = unmanagedDeclaration?.takeRetainedValue() as? [AnyHashable: Any] else { return nil } @@ -356,137 +360,137 @@ public class UTI: RawRepresentable, Equatable { public extension UTI { - static let item = UTI(rawValue: kUTTypeItem as String) - static let content = UTI(rawValue: kUTTypeContent as String) - static let compositeContent = UTI(rawValue: kUTTypeCompositeContent as String) - static let message = UTI(rawValue: kUTTypeMessage as String) - static let contact = UTI(rawValue: kUTTypeContact as String) - static let archive = UTI(rawValue: kUTTypeArchive as String) - static let diskImage = UTI(rawValue: kUTTypeDiskImage as String) - static let data = UTI(rawValue: kUTTypeData as String) - static let directory = UTI(rawValue: kUTTypeDirectory as String) - static let resolvable = UTI(rawValue: kUTTypeResolvable as String) - static let symLink = UTI(rawValue: kUTTypeSymLink as String) - static let executable = UTI(rawValue: kUTTypeExecutable as String) - static let mountPoint = UTI(rawValue: kUTTypeMountPoint as String) - static let aliasFile = UTI(rawValue: kUTTypeAliasFile as String) - static let aliasRecord = UTI(rawValue: kUTTypeAliasRecord as String) - static let urlBookmarkData = UTI(rawValue: kUTTypeURLBookmarkData as String) - static let url = UTI(rawValue: kUTTypeURL as String) - static let fileURL = UTI(rawValue: kUTTypeFileURL as String) - static let text = UTI(rawValue: kUTTypeText as String) - static let plainText = UTI(rawValue: kUTTypePlainText as String) - static let utf8PlainText = UTI(rawValue: kUTTypeUTF8PlainText as String) - static let utf16ExternalPlainText = UTI(rawValue: kUTTypeUTF16ExternalPlainText as String) - static let utf16PlainText = UTI(rawValue: kUTTypeUTF16PlainText as String) - static let delimitedText = UTI(rawValue: kUTTypeDelimitedText as String) - static let commaSeparatedText = UTI(rawValue: kUTTypeCommaSeparatedText as String) - static let tabSeparatedText = UTI(rawValue: kUTTypeTabSeparatedText as String) - static let utf8TabSeparatedText = UTI(rawValue: kUTTypeUTF8TabSeparatedText as String) - static let rtf = UTI(rawValue: kUTTypeRTF as String) - static let html = UTI(rawValue: kUTTypeHTML as String) - static let xml = UTI(rawValue: kUTTypeXML as String) - static let sourceCode = UTI(rawValue: kUTTypeSourceCode as String) - static let assemblyLanguageSource = UTI(rawValue: kUTTypeAssemblyLanguageSource as String) - static let cSource = UTI(rawValue: kUTTypeCSource as String) - static let objectiveCSource = UTI(rawValue: kUTTypeObjectiveCSource as String) + static let item = UTI(rawValue: kUTTypeItem as String) + static let content = UTI(rawValue: kUTTypeContent as String) + static let compositeContent = UTI(rawValue: kUTTypeCompositeContent as String) + static let message = UTI(rawValue: kUTTypeMessage as String) + static let contact = UTI(rawValue: kUTTypeContact as String) + static let archive = UTI(rawValue: kUTTypeArchive as String) + static let diskImage = UTI(rawValue: kUTTypeDiskImage as String) + static let data = UTI(rawValue: kUTTypeData as String) + static let directory = UTI(rawValue: kUTTypeDirectory as String) + static let resolvable = UTI(rawValue: kUTTypeResolvable as String) + static let symLink = UTI(rawValue: kUTTypeSymLink as String) + static let executable = UTI(rawValue: kUTTypeExecutable as String) + static let mountPoint = UTI(rawValue: kUTTypeMountPoint as String) + static let aliasFile = UTI(rawValue: kUTTypeAliasFile as String) + static let aliasRecord = UTI(rawValue: kUTTypeAliasRecord as String) + static let urlBookmarkData = UTI(rawValue: kUTTypeURLBookmarkData as String) + static let url = UTI(rawValue: kUTTypeURL as String) + static let fileURL = UTI(rawValue: kUTTypeFileURL as String) + static let text = UTI(rawValue: kUTTypeText as String) + static let plainText = UTI(rawValue: kUTTypePlainText as String) + static let utf8PlainText = UTI(rawValue: kUTTypeUTF8PlainText as String) + static let utf16ExternalPlainText = UTI(rawValue: kUTTypeUTF16ExternalPlainText as String) + static let utf16PlainText = UTI(rawValue: kUTTypeUTF16PlainText as String) + static let delimitedText = UTI(rawValue: kUTTypeDelimitedText as String) + static let commaSeparatedText = UTI(rawValue: kUTTypeCommaSeparatedText as String) + static let tabSeparatedText = UTI(rawValue: kUTTypeTabSeparatedText as String) + static let utf8TabSeparatedText = UTI(rawValue: kUTTypeUTF8TabSeparatedText as String) + static let rtf = UTI(rawValue: kUTTypeRTF as String) + static let html = UTI(rawValue: kUTTypeHTML as String) + static let xml = UTI(rawValue: kUTTypeXML as String) + static let sourceCode = UTI(rawValue: kUTTypeSourceCode as String) + static let assemblyLanguageSource = UTI(rawValue: kUTTypeAssemblyLanguageSource as String) + static let cSource = UTI(rawValue: kUTTypeCSource as String) + static let objectiveCSource = UTI(rawValue: kUTTypeObjectiveCSource as String) @available( OSX 10.11, iOS 9.0, * ) - static let swiftSource = UTI(rawValue: kUTTypeSwiftSource as String) - static let cPlusPlusSource = UTI(rawValue: kUTTypeCPlusPlusSource as String) - static let objectiveCPlusPlusSource = UTI(rawValue: kUTTypeObjectiveCPlusPlusSource as String) - static let cHeader = UTI(rawValue: kUTTypeCHeader as String) - static let cPlusPlusHeader = UTI(rawValue: kUTTypeCPlusPlusHeader as String) - static let javaSource = UTI(rawValue: kUTTypeJavaSource as String) - static let script = UTI(rawValue: kUTTypeScript as String) - static let appleScript = UTI(rawValue: kUTTypeAppleScript as String) - static let osaScript = UTI(rawValue: kUTTypeOSAScript as String) - static let osaScriptBundle = UTI(rawValue: kUTTypeOSAScriptBundle as String) - static let javaScript = UTI(rawValue: kUTTypeJavaScript as String) - static let shellScript = UTI(rawValue: kUTTypeShellScript as String) - static let perlScript = UTI(rawValue: kUTTypePerlScript as String) - static let pythonScript = UTI(rawValue: kUTTypePythonScript as String) - static let rubyScript = UTI(rawValue: kUTTypeRubyScript as String) - static let phpScript = UTI(rawValue: kUTTypePHPScript as String) - static let json = UTI(rawValue: kUTTypeJSON as String) - static let propertyList = UTI(rawValue: kUTTypePropertyList as String) - static let xmlPropertyList = UTI(rawValue: kUTTypeXMLPropertyList as String) - static let binaryPropertyList = UTI(rawValue: kUTTypeBinaryPropertyList as String) - static let pdf = UTI(rawValue: kUTTypePDF as String) - static let rtfd = UTI(rawValue: kUTTypeRTFD as String) - static let flatRTFD = UTI(rawValue: kUTTypeFlatRTFD as String) - static let txnTextAndMultimediaData = UTI(rawValue: kUTTypeTXNTextAndMultimediaData as String) - static let webArchive = UTI(rawValue: kUTTypeWebArchive as String) - static let image = UTI(rawValue: kUTTypeImage as String) - static let jpeg = UTI(rawValue: kUTTypeJPEG as String) - static let jpeg2000 = UTI(rawValue: kUTTypeJPEG2000 as String) - static let tiff = UTI(rawValue: kUTTypeTIFF as String) - static let pict = UTI(rawValue: kUTTypePICT as String) - static let gif = UTI(rawValue: kUTTypeGIF as String) - static let png = UTI(rawValue: kUTTypePNG as String) - static let quickTimeImage = UTI(rawValue: kUTTypeQuickTimeImage as String) - static let appleICNS = UTI(rawValue: kUTTypeAppleICNS as String) - static let bmp = UTI(rawValue: kUTTypeBMP as String) - static let ico = UTI(rawValue: kUTTypeICO as String) - static let rawImage = UTI(rawValue: kUTTypeRawImage as String) - static let scalableVectorGraphics = UTI(rawValue: kUTTypeScalableVectorGraphics as String) + static let swiftSource = UTI(rawValue: kUTTypeSwiftSource as String) + static let cPlusPlusSource = UTI(rawValue: kUTTypeCPlusPlusSource as String) + static let objectiveCPlusPlusSource = UTI(rawValue: kUTTypeObjectiveCPlusPlusSource as String) + static let cHeader = UTI(rawValue: kUTTypeCHeader as String) + static let cPlusPlusHeader = UTI(rawValue: kUTTypeCPlusPlusHeader as String) + static let javaSource = UTI(rawValue: kUTTypeJavaSource as String) + static let script = UTI(rawValue: kUTTypeScript as String) + static let appleScript = UTI(rawValue: kUTTypeAppleScript as String) + static let osaScript = UTI(rawValue: kUTTypeOSAScript as String) + static let osaScriptBundle = UTI(rawValue: kUTTypeOSAScriptBundle as String) + static let javaScript = UTI(rawValue: kUTTypeJavaScript as String) + static let shellScript = UTI(rawValue: kUTTypeShellScript as String) + static let perlScript = UTI(rawValue: kUTTypePerlScript as String) + static let pythonScript = UTI(rawValue: kUTTypePythonScript as String) + static let rubyScript = UTI(rawValue: kUTTypeRubyScript as String) + static let phpScript = UTI(rawValue: kUTTypePHPScript as String) + static let json = UTI(rawValue: kUTTypeJSON as String) + static let propertyList = UTI(rawValue: kUTTypePropertyList as String) + static let xmlPropertyList = UTI(rawValue: kUTTypeXMLPropertyList as String) + static let binaryPropertyList = UTI(rawValue: kUTTypeBinaryPropertyList as String) + static let pdf = UTI(rawValue: kUTTypePDF as String) + static let rtfd = UTI(rawValue: kUTTypeRTFD as String) + static let flatRTFD = UTI(rawValue: kUTTypeFlatRTFD as String) + static let txnTextAndMultimediaData = UTI(rawValue: kUTTypeTXNTextAndMultimediaData as String) + static let webArchive = UTI(rawValue: kUTTypeWebArchive as String) + static let image = UTI(rawValue: kUTTypeImage as String) + static let jpeg = UTI(rawValue: kUTTypeJPEG as String) + static let jpeg2000 = UTI(rawValue: kUTTypeJPEG2000 as String) + static let tiff = UTI(rawValue: kUTTypeTIFF as String) + static let pict = UTI(rawValue: kUTTypePICT as String) + static let gif = UTI(rawValue: kUTTypeGIF as String) + static let png = UTI(rawValue: kUTTypePNG as String) + static let quickTimeImage = UTI(rawValue: kUTTypeQuickTimeImage as String) + static let appleICNS = UTI(rawValue: kUTTypeAppleICNS as String) + static let bmp = UTI(rawValue: kUTTypeBMP as String) + static let ico = UTI(rawValue: kUTTypeICO as String) + static let rawImage = UTI(rawValue: kUTTypeRawImage as String) + static let scalableVectorGraphics = UTI(rawValue: kUTTypeScalableVectorGraphics as String) @available(OSX 10.12, iOS 9.1, watchOS 2.1, *) - static let livePhoto = UTI(rawValue: kUTTypeLivePhoto as String) + static let livePhoto = UTI(rawValue: kUTTypeLivePhoto as String) @available(OSX 10.12, iOS 9.1, *) - static let audiovisualContent = UTI(rawValue: kUTTypeAudiovisualContent as String) - static let movie = UTI(rawValue: kUTTypeMovie as String) - static let video = UTI(rawValue: kUTTypeVideo as String) - static let audio = UTI(rawValue: kUTTypeAudio as String) - static let quickTimeMovie = UTI(rawValue: kUTTypeQuickTimeMovie as String) - static let mpeg = UTI(rawValue: kUTTypeMPEG as String) - static let mpeg2Video = UTI(rawValue: kUTTypeMPEG2Video as String) - static let mpeg2TransportStream = UTI(rawValue: kUTTypeMPEG2TransportStream as String) - static let mp3 = UTI(rawValue: kUTTypeMP3 as String) - static let mpeg4 = UTI(rawValue: kUTTypeMPEG4 as String) - static let mpeg4Audio = UTI(rawValue: kUTTypeMPEG4Audio as String) - static let appleProtectedMPEG4Audio = UTI(rawValue: kUTTypeAppleProtectedMPEG4Audio as String) - static let appleProtectedMPEG4Video = UTI(rawValue: kUTTypeAppleProtectedMPEG4Video as String) - static let aviMovie = UTI(rawValue: kUTTypeAVIMovie as String) - static let audioInterchangeFileFormat = UTI(rawValue: kUTTypeAudioInterchangeFileFormat as String) - static let waveformAudio = UTI(rawValue: kUTTypeWaveformAudio as String) - static let midiAudio = UTI(rawValue: kUTTypeMIDIAudio as String) - static let playlist = UTI(rawValue: kUTTypePlaylist as String) - static let m3UPlaylist = UTI(rawValue: kUTTypeM3UPlaylist as String) - static let folder = UTI(rawValue: kUTTypeFolder as String) - static let volume = UTI(rawValue: kUTTypeVolume as String) - static let package = UTI(rawValue: kUTTypePackage as String) - static let bundle = UTI(rawValue: kUTTypeBundle as String) - static let pluginBundle = UTI(rawValue: kUTTypePluginBundle as String) - static let spotlightImporter = UTI(rawValue: kUTTypeSpotlightImporter as String) - static let quickLookGenerator = UTI(rawValue: kUTTypeQuickLookGenerator as String) - static let xpcService = UTI(rawValue: kUTTypeXPCService as String) - static let framework = UTI(rawValue: kUTTypeFramework as String) - static let application = UTI(rawValue: kUTTypeApplication as String) - static let applicationBundle = UTI(rawValue: kUTTypeApplicationBundle as String) - static let applicationFile = UTI(rawValue: kUTTypeApplicationFile as String) - static let unixExecutable = UTI(rawValue: kUTTypeUnixExecutable as String) - static let windowsExecutable = UTI(rawValue: kUTTypeWindowsExecutable as String) - static let javaClass = UTI(rawValue: kUTTypeJavaClass as String) - static let javaArchive = UTI(rawValue: kUTTypeJavaArchive as String) - static let systemPreferencesPane = UTI(rawValue: kUTTypeSystemPreferencesPane as String) - static let gnuZipArchive = UTI(rawValue: kUTTypeGNUZipArchive as String) - static let bzip2Archive = UTI(rawValue: kUTTypeBzip2Archive as String) - static let zipArchive = UTI(rawValue: kUTTypeZipArchive as String) - static let spreadsheet = UTI(rawValue: kUTTypeSpreadsheet as String) - static let presentation = UTI(rawValue: kUTTypePresentation as String) - static let database = UTI(rawValue: kUTTypeDatabase as String) - static let vCard = UTI(rawValue: kUTTypeVCard as String) - static let toDoItem = UTI(rawValue: kUTTypeToDoItem as String) - static let calendarEvent = UTI(rawValue: kUTTypeCalendarEvent as String) - static let emailMessage = UTI(rawValue: kUTTypeEmailMessage as String) - static let internetLocation = UTI(rawValue: kUTTypeInternetLocation as String) - static let inkText = UTI(rawValue: kUTTypeInkText as String) - static let font = UTI(rawValue: kUTTypeFont as String) - static let bookmark = UTI(rawValue: kUTTypeBookmark as String) - static let _3DContent = UTI(rawValue: kUTType3DContent as String) - static let pkcs12 = UTI(rawValue: kUTTypePKCS12 as String) - static let x509Certificate = UTI(rawValue: kUTTypeX509Certificate as String) - static let electronicPublication = UTI(rawValue: kUTTypeElectronicPublication as String) - static let log = UTI(rawValue: kUTTypeLog as String) + static let audiovisualContent = UTI(rawValue: kUTTypeAudiovisualContent as String) + static let movie = UTI(rawValue: kUTTypeMovie as String) + static let video = UTI(rawValue: kUTTypeVideo as String) + static let audio = UTI(rawValue: kUTTypeAudio as String) + static let quickTimeMovie = UTI(rawValue: kUTTypeQuickTimeMovie as String) + static let mpeg = UTI(rawValue: kUTTypeMPEG as String) + static let mpeg2Video = UTI(rawValue: kUTTypeMPEG2Video as String) + static let mpeg2TransportStream = UTI(rawValue: kUTTypeMPEG2TransportStream as String) + static let mp3 = UTI(rawValue: kUTTypeMP3 as String) + static let mpeg4 = UTI(rawValue: kUTTypeMPEG4 as String) + static let mpeg4Audio = UTI(rawValue: kUTTypeMPEG4Audio as String) + static let appleProtectedMPEG4Audio = UTI(rawValue: kUTTypeAppleProtectedMPEG4Audio as String) + static let appleProtectedMPEG4Video = UTI(rawValue: kUTTypeAppleProtectedMPEG4Video as String) + static let aviMovie = UTI(rawValue: kUTTypeAVIMovie as String) + static let audioInterchangeFileFormat = UTI(rawValue: kUTTypeAudioInterchangeFileFormat as String) + static let waveformAudio = UTI(rawValue: kUTTypeWaveformAudio as String) + static let midiAudio = UTI(rawValue: kUTTypeMIDIAudio as String) + static let playlist = UTI(rawValue: kUTTypePlaylist as String) + static let m3UPlaylist = UTI(rawValue: kUTTypeM3UPlaylist as String) + static let folder = UTI(rawValue: kUTTypeFolder as String) + static let volume = UTI(rawValue: kUTTypeVolume as String) + static let package = UTI(rawValue: kUTTypePackage as String) + static let bundle = UTI(rawValue: kUTTypeBundle as String) + static let pluginBundle = UTI(rawValue: kUTTypePluginBundle as String) + static let spotlightImporter = UTI(rawValue: kUTTypeSpotlightImporter as String) + static let quickLookGenerator = UTI(rawValue: kUTTypeQuickLookGenerator as String) + static let xpcService = UTI(rawValue: kUTTypeXPCService as String) + static let framework = UTI(rawValue: kUTTypeFramework as String) + static let application = UTI(rawValue: kUTTypeApplication as String) + static let applicationBundle = UTI(rawValue: kUTTypeApplicationBundle as String) + static let applicationFile = UTI(rawValue: kUTTypeApplicationFile as String) + static let unixExecutable = UTI(rawValue: kUTTypeUnixExecutable as String) + static let windowsExecutable = UTI(rawValue: kUTTypeWindowsExecutable as String) + static let javaClass = UTI(rawValue: kUTTypeJavaClass as String) + static let javaArchive = UTI(rawValue: kUTTypeJavaArchive as String) + static let systemPreferencesPane = UTI(rawValue: kUTTypeSystemPreferencesPane as String) + static let gnuZipArchive = UTI(rawValue: kUTTypeGNUZipArchive as String) + static let bzip2Archive = UTI(rawValue: kUTTypeBzip2Archive as String) + static let zipArchive = UTI(rawValue: kUTTypeZipArchive as String) + static let spreadsheet = UTI(rawValue: kUTTypeSpreadsheet as String) + static let presentation = UTI(rawValue: kUTTypePresentation as String) + static let database = UTI(rawValue: kUTTypeDatabase as String) + static let vCard = UTI(rawValue: kUTTypeVCard as String) + static let toDoItem = UTI(rawValue: kUTTypeToDoItem as String) + static let calendarEvent = UTI(rawValue: kUTTypeCalendarEvent as String) + static let emailMessage = UTI(rawValue: kUTTypeEmailMessage as String) + static let internetLocation = UTI(rawValue: kUTTypeInternetLocation as String) + static let inkText = UTI(rawValue: kUTTypeInkText as String) + static let font = UTI(rawValue: kUTTypeFont as String) + static let bookmark = UTI(rawValue: kUTTypeBookmark as String) + static let _3DContent = UTI(rawValue: kUTType3DContent as String) + static let pkcs12 = UTI(rawValue: kUTTypePKCS12 as String) + static let x509Certificate = UTI(rawValue: kUTTypeX509Certificate as String) + static let electronicPublication = UTI(rawValue: kUTTypeElectronicPublication as String) + static let log = UTI(rawValue: kUTTypeLog as String) } #if os(OSX) diff --git a/Riot/Modules/MatrixKit/MatrixKit.h b/Riot/Modules/MatrixKit/MatrixKit.h index b6e5806f4..d9cf57cf0 100644 --- a/Riot/Modules/MatrixKit/MatrixKit.h +++ b/Riot/Modules/MatrixKit/MatrixKit.h @@ -69,7 +69,6 @@ #import "MXKRoomCreationView.h" #import "MXKRoomInputToolbarView.h" -#import "MXKRoomInputToolbarViewWithHPGrowingText.h" #import "MXKRoomDataSourceManager.h" diff --git a/Riot/Modules/MatrixKit/Models/Account/MXKAccountManager.m b/Riot/Modules/MatrixKit/Models/Account/MXKAccountManager.m index 9c37c1696..352e0ad6e 100644 --- a/Riot/Modules/MatrixKit/Models/Account/MXKAccountManager.m +++ b/Riot/Modules/MatrixKit/Models/Account/MXKAccountManager.m @@ -104,6 +104,8 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa } } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)saveAccounts { NSDate *startDate = [NSDate date]; @@ -123,6 +125,7 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa MXLogDebug(@"[MXKAccountManager] saveAccounts. Done (result: %@) in %.0fms", @(result), [[NSDate date] timeIntervalSinceDate:startDate] * 1000); } +#pragma clang diagnostic pop - (void)addAccount:(MXKAccount *)account andOpenSession:(BOOL)openSession { @@ -608,6 +611,8 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa return [matrixKitCacheFolder stringByAppendingPathComponent:kMXKAccountsKey]; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)loadAccounts { MXLogDebug(@"[MXKAccountManager] loadAccounts"); @@ -675,6 +680,7 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa mxAccounts = [NSMutableArray array]; } } +#pragma clang diagnostic pop - (NSData*)encryptData:(NSData*)data { @@ -708,6 +714,8 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa return data; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)migrateAccounts { NSString *pathOld = [[MXKAppSettings cacheFolder] stringByAppendingPathComponent:kMXKAccountsKeyOld]; @@ -727,6 +735,7 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa [fileManager removeItemAtPath:pathOld error:nil]; } } +#pragma clang diagnostic pop - (void)readAndWriteCredentials:(void (^)(NSArray * _Nullable readData, void (^completion)(BOOL didUpdateCredentials)))readAnWriteHandler { diff --git a/Riot/Modules/MatrixKit/Models/Contact/MXKContact.h b/Riot/Modules/MatrixKit/Models/Contact/MXKContact.h index 3d8e8af24..a927577e9 100644 --- a/Riot/Modules/MatrixKit/Models/Contact/MXKContact.h +++ b/Riot/Modules/MatrixKit/Models/Contact/MXKContact.h @@ -93,6 +93,8 @@ extern NSString *const kMXKContactDefaultContactPrefixId; */ - (void)resetMatrixThumbnail; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" /** The contact ID from native phonebook record */ @@ -105,6 +107,7 @@ extern NSString *const kMXKContactDefaultContactPrefixId; @return MXKContact instance */ - (id)initLocalContactWithABRecord:(ABRecordRef)record; +#pragma clang diagnostic pop /** Create a matrix contact with the dedicated info diff --git a/Riot/Modules/MatrixKit/Models/Contact/MXKContact.m b/Riot/Modules/MatrixKit/Models/Contact/MXKContact.m index 2b1e57727..f949b3a9b 100644 --- a/Riot/Modules/MatrixKit/Models/Contact/MXKContact.m +++ b/Riot/Modules/MatrixKit/Models/Contact/MXKContact.m @@ -40,6 +40,8 @@ NSString *const kMXKContactDefaultContactPrefixId = @"Default_"; @implementation MXKContact @synthesize isMatrixContact, isThirdPartyInvite; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + (NSString*)contactID:(ABRecordRef)record { return [NSString stringWithFormat:@"%@%d", kMXKContactLocalContactPrefixId, ABRecordGetRecordID(record)]; @@ -217,6 +219,7 @@ NSString *const kMXKContactDefaultContactPrefixId = @"Default_"; } return self; } +#pragma clang diagnostic pop - (id)initMatrixContactWithDisplayName:(NSString*)displayName andMatrixID:(NSString*)matrixID { diff --git a/Riot/Modules/MatrixKit/Models/Contact/MXKContactManager.m b/Riot/Modules/MatrixKit/Models/Contact/MXKContactManager.m index 52ac60a68..0ccf8096b 100644 --- a/Riot/Modules/MatrixKit/Models/Contact/MXKContactManager.m +++ b/Riot/Modules/MatrixKit/Models/Contact/MXKContactManager.m @@ -537,6 +537,8 @@ NSString *const MXKContactManagerDataType = @"org.matrix.kit.MXKContactManagerDa } } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (void)refreshLocalContacts { MXLogDebug(@"[MXKContactManager] refreshLocalContacts : Started"); @@ -721,6 +723,7 @@ NSString *const MXKContactManagerDataType = @"org.matrix.kit.MXKContactManagerDa }); } } +#pragma clang diagnostic pop - (void)updateMatrixIDsForLocalContact:(MXKContact *)contact { @@ -1582,6 +1585,9 @@ static NSString *matrixIDsDictFile = @"matrixIDsDictV2"; static NSString *localContactsFile = @"localContactsV2"; static NSString *contactsBookInfoFile = @"contactsV2"; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + - (NSString*)dataFilePathForComponent:(NSString*)component { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); @@ -1857,6 +1863,8 @@ static NSString *contactsBookInfoFile = @"contactsV2"; } } +#pragma clang diagnostic pop + - (BOOL)encryptAndSaveData:(NSData*)data toFile:(NSString*)fileName { NSError *error = nil; diff --git a/Riot/Modules/MatrixKit/Models/MXKAppSettings.m b/Riot/Modules/MatrixKit/Models/MXKAppSettings.m index 88aa527f7..c0984a6da 100644 --- a/Riot/Modules/MatrixKit/Models/MXKAppSettings.m +++ b/Riot/Modules/MatrixKit/Models/MXKAppSettings.m @@ -670,6 +670,8 @@ static NSString *const kMXAppGroupID = @"group.org.matrix"; } } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (NSString*)phonebookCountryCode { NSString* res = phonebookCountryCode; @@ -699,6 +701,7 @@ static NSString *const kMXAppGroupID = @"group.org.matrix"; return res; } +#pragma clang diagnostic pop - (void)setPhonebookCountryCode:(NSString *)stringValue { diff --git a/Riot/Modules/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.h b/Riot/Modules/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.h index 0748f1e62..c03c4c4de 100644 --- a/Riot/Modules/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.h +++ b/Riot/Modules/MatrixKit/Models/RoomList/MXKSessionRecentsDataSource.h @@ -30,8 +30,8 @@ extern NSString *const kMXKRecentCellIdentifier; /** The recents data source based on a unique matrix session. + Deprecated: Please see MXSession.roomListDataManager */ -MXK_DEPRECATED_ATTRIBUTE_WITH_MSG("See MXSession.roomListDataManager") @interface MXKSessionRecentsDataSource : MXKDataSource { @protected diff --git a/Riot/Modules/MatrixKit/Utils/MXKConstants.h b/Riot/Modules/MatrixKit/Utils/MXKConstants.h index b580d234e..7a5659b8c 100644 --- a/Riot/Modules/MatrixKit/Utils/MXKConstants.h +++ b/Riot/Modules/MatrixKit/Utils/MXKConstants.h @@ -17,9 +17,6 @@ #import -#define MXK_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) -#define MXK_DEPRECATED_ATTRIBUTE_WITH_MSG(msg) __attribute((deprecated((msg)))) - /** The Matrix iOS Kit version. */ diff --git a/Riot/Modules/MatrixKit/Utils/MXKDocumentPickerPresenter.swift b/Riot/Modules/MatrixKit/Utils/MXKDocumentPickerPresenter.swift index 1f9b9c89c..0ff493e30 100644 --- a/Riot/Modules/MatrixKit/Utils/MXKDocumentPickerPresenter.swift +++ b/Riot/Modules/MatrixKit/Utils/MXKDocumentPickerPresenter.swift @@ -24,7 +24,8 @@ import MobileCoreServices /// MXKDocumentPickerPresenter presents a controller that provides access to documents or destinations outside the app’s sandbox. /// Internally presents a UIDocumentPickerViewController in UIDocumentPickerMode.import. -/// Note: You must turn on the iCloud Documents capabilities in Xcode (see https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/DocumentPickerProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40014451) +/// Note: You must turn on the iCloud Documents capabilities in Xcode +/// (see https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/DocumentPickerProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40014451) @objcMembers public class MXKDocumentPickerPresenter: NSObject { diff --git a/Riot/Modules/MatrixKit/Utils/MXKTools.m b/Riot/Modules/MatrixKit/Utils/MXKTools.m index c941fbc98..7e3231324 100644 --- a/Riot/Modules/MatrixKit/Utils/MXKTools.m +++ b/Riot/Modules/MatrixKit/Utils/MXKTools.m @@ -1112,7 +1112,7 @@ manualChangeMessageForVideo:(NSString*)manualChangeMessageForVideo // Caution: We need here to escape the non-ASCII characters (like '#' in room alias) // to convert the link into a legal URL string. NSString *link = [attributedString.string substringWithRange:match.range]; - link = [link stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + link = [link stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; [*mutableAttributedString addAttribute:NSLinkAttributeName value:link range:match.range]; } }]; diff --git a/Riot/Modules/MatrixKit/Utils/MXKUTI.swift b/Riot/Modules/MatrixKit/Utils/MXKUTI.swift index 911beec65..87822cd7d 100644 --- a/Riot/Modules/MatrixKit/Utils/MXKUTI.swift +++ b/Riot/Modules/MatrixKit/Utils/MXKUTI.swift @@ -20,7 +20,7 @@ import MobileCoreServices // We do not use the SwiftUTI pod anymore // The library is embedded in MatrixKit. See Libs/SwiftUTI/README.md for more details -//import SwiftUTI +// import SwiftUTI /// MXKUTI represents a Universal Type Identifier (e.g. kUTTypePNG). /// See https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html#//apple_ref/doc/uid/TP40001319-CH202-SW5 for more information. @@ -134,6 +134,8 @@ extension MXKUTI { self.init(rawValue: uti as String) } + // swiftlint:disable unused_optional_binding + /// Initialize with local file URL. /// This method is currently applicable only to URLs for file system resources. /// @@ -153,6 +155,8 @@ extension MXKUTI { } } + // swiftlint:enable unused_optional_binding + public convenience init?(localFileURL: URL) { self.init(localFileURL: localFileURL, loadResourceValues: true) } @@ -173,6 +177,8 @@ extension MXKUTI { } } +// swiftlint:disable force_unwrapping + // MARK: - Some system defined UTIs extension MXKUTI { public static let data = MXKUTI(cfRawValue: kUTTypeData)! @@ -190,6 +196,8 @@ extension MXKUTI { public static let xml = MXKUTI(cfRawValue: kUTTypeXML)! } +// swiftlint:enable force_unwrapping + // MARK: - Convenience static methods extension MXKUTI { diff --git a/Riot/Modules/MatrixKit/Views/Authentication/MXKAuthenticationFallbackWebView.m b/Riot/Modules/MatrixKit/Views/Authentication/MXKAuthenticationFallbackWebView.m index 09c50ffc6..ad44e34d8 100644 --- a/Riot/Modules/MatrixKit/Views/Authentication/MXKAuthenticationFallbackWebView.m +++ b/Riot/Modules/MatrixKit/Views/Authentication/MXKAuthenticationFallbackWebView.m @@ -120,7 +120,7 @@ sendObjectMessage({ \ MXLogDebug(@"[MXKAuthenticationFallbackWebView] URL has js: prefix"); // Listen only to scheme of the JS-WKWebView bridge - NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; + NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByRemovingPercentEncoding]; NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; NSError *error; diff --git a/Riot/Modules/MatrixKit/Views/Authentication/MXKAuthenticationRecaptchaWebView.m b/Riot/Modules/MatrixKit/Views/Authentication/MXKAuthenticationRecaptchaWebView.m index 8e3bfa6fa..cfcafc744 100644 --- a/Riot/Modules/MatrixKit/Views/Authentication/MXKAuthenticationRecaptchaWebView.m +++ b/Riot/Modules/MatrixKit/Views/Authentication/MXKAuthenticationRecaptchaWebView.m @@ -102,7 +102,7 @@ var onloadCallback = function() { \ if ([urlString hasPrefix:@"js:"]) { // Listen only to scheme of the JS-WKWebView bridge - NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; + NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; NSError *error; diff --git a/Riot/Modules/MatrixKit/Views/EncryptionInfoView/MXKEncryptionInfoView.m b/Riot/Modules/MatrixKit/Views/EncryptionInfoView/MXKEncryptionInfoView.m index a6537cbd5..cc6c3175e 100644 --- a/Riot/Modules/MatrixKit/Views/EncryptionInfoView/MXKEncryptionInfoView.m +++ b/Riot/Modules/MatrixKit/Views/EncryptionInfoView/MXKEncryptionInfoView.m @@ -417,7 +417,7 @@ static NSAttributedString *verticalWhitespace = nil; [_mxSession.crypto setDeviceVerification:MXDeviceVerified forDevice:_mxDeviceInfo.deviceId ofUser:_mxDeviceInfo.userId success:^{ // Refresh data - _mxDeviceInfo = [self.mxSession.crypto eventDeviceInfo:self.mxEvent]; + self->_mxDeviceInfo = [self.mxSession.crypto eventDeviceInfo:self.mxEvent]; if (self->_delegate) { [self->_delegate encryptionInfoView:self didDeviceInfoVerifiedChange:self.mxDeviceInfo]; @@ -473,7 +473,7 @@ static NSAttributedString *verticalWhitespace = nil; [_mxSession.crypto setDeviceVerification:verificationStatus forDevice:_mxDeviceInfo.deviceId ofUser:_mxDeviceInfo.userId success:^{ // Refresh data - _mxDeviceInfo = [self.mxSession.crypto eventDeviceInfo:self.mxEvent]; + self->_mxDeviceInfo = [self.mxSession.crypto eventDeviceInfo:self.mxEvent]; if (self->_delegate) { diff --git a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.h b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.h deleted file mode 100644 index b10b54fa6..000000000 --- a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright 2015 OpenMarket Ltd - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#import "MXKRoomInputToolbarView.h" - -#import - -/** - `MXKRoomInputToolbarViewWithHPGrowingText` is a MXKRoomInputToolbarView-inherited class in which message - composer is based on `HPGrowingTextView`. - - Toolbar buttons are not overridden by this class. We keep the default implementation. - */ -@interface MXKRoomInputToolbarViewWithHPGrowingText : MXKRoomInputToolbarView -{ -@protected - HPGrowingTextView *growingTextView; -} - -@end diff --git a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.m b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.m deleted file mode 100644 index fe5f87ff7..000000000 --- a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.m +++ /dev/null @@ -1,187 +0,0 @@ -/* - Copyright 2015 OpenMarket Ltd - Copyright 2017 Vector Creations Ltd - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#import "MXKRoomInputToolbarViewWithHPGrowingText.h" - -@interface MXKRoomInputToolbarViewWithHPGrowingText() -{ - // HPGrowingTextView triggers growingTextViewDidChange event when it recomposes itself - // Save the last edited text to prevent unexpected typing events - NSString* lastEditedText; -} - -/** - Message composer defined in `messageComposerContainer`. - */ -@property (nonatomic) IBOutlet HPGrowingTextView *growingTextView; - -@end - -@implementation MXKRoomInputToolbarViewWithHPGrowingText -@synthesize growingTextView; - -+ (UINib *)nib -{ - return [UINib nibWithNibName:NSStringFromClass([MXKRoomInputToolbarViewWithHPGrowingText class]) - bundle:[NSBundle bundleForClass:[MXKRoomInputToolbarViewWithHPGrowingText class]]]; -} - -- (void)awakeFromNib -{ - [super awakeFromNib]; - - // Handle message composer based on HPGrowingTextView use - growingTextView.delegate = self; - - [growingTextView setTranslatesAutoresizingMaskIntoConstraints: NO]; - - // Add an accessory view to the text view in order to retrieve keyboard view. - inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero]; - growingTextView.internalTextView.inputAccessoryView = self.inputAccessoryView; - - // on IOS 8, the growing textview animation could trigger weird UI animations - // indeed, the messages tableView can be refreshed while its height is updated (e.g. when setting a message) - growingTextView.animateHeightChange = NO; - - lastEditedText = nil; -} - -- (void)dealloc -{ - [self destroy]; -} - --(void)customizeViewRendering -{ - [super customizeViewRendering]; - - // set text input font - growingTextView.font = [UIFont systemFontOfSize:14]; - - // draw a rounded border around the textView - growingTextView.layer.cornerRadius = 5; - growingTextView.layer.borderWidth = 1; - growingTextView.layer.borderColor = [UIColor lightGrayColor].CGColor; - growingTextView.clipsToBounds = YES; - growingTextView.backgroundColor = [UIColor whiteColor]; -} - -- (void)destroy -{ - if (growingTextView) - { - growingTextView.delegate = nil; - growingTextView = nil; - } - - [super destroy]; -} - -- (void)setMaxHeight:(CGFloat)maxHeight -{ - growingTextView.maxHeight = maxHeight - (self.messageComposerContainerTopConstraint.constant + self.messageComposerContainerBottomConstraint.constant); - [growingTextView refreshHeight]; - - super.maxHeight = maxHeight; -} - -- (NSString*)textMessage -{ - return growingTextView.text; -} - -- (void)setTextMessage:(NSString *)textMessage -{ - growingTextView.text = textMessage; - self.rightInputToolbarButton.enabled = textMessage.length; -} - -- (void)pasteText:(NSString *)text -{ - self.textMessage = [growingTextView.text stringByReplacingCharactersInRange:growingTextView.selectedRange withString:text]; -} - -- (void)setPlaceholder:(NSString *)inPlaceholder -{ - [super setPlaceholder:inPlaceholder]; - growingTextView.placeholder = inPlaceholder; -} - -- (BOOL)becomeFirstResponder -{ - return [growingTextView becomeFirstResponder]; -} - -- (void)dismissKeyboard -{ - [growingTextView resignFirstResponder]; -} - -#pragma mark - HPGrowingTextView delegate - -- (void)growingTextViewDidEndEditing:(HPGrowingTextView *)sender -{ - if ([self.delegate respondsToSelector:@selector(roomInputToolbarView:isTyping:)]) - { - [self.delegate roomInputToolbarView:self isTyping:NO]; - } -} - -- (void)growingTextViewDidChange:(HPGrowingTextView *)sender -{ - NSString *msg = growingTextView.text; - - // HPGrowingTextView triggers growingTextViewDidChange event when it recomposes itself. - // Save the last edited text to prevent unexpected typing events - if (![lastEditedText isEqualToString:msg]) - { - lastEditedText = msg; - if (msg.length) - { - if ([self.delegate respondsToSelector:@selector(roomInputToolbarView:isTyping:)]) - { - [self.delegate roomInputToolbarView:self isTyping:YES]; - } - self.rightInputToolbarButton.enabled = YES; - } - else - { - if ([self.delegate respondsToSelector:@selector(roomInputToolbarView:isTyping:)]) - { - [self.delegate roomInputToolbarView:self isTyping:NO]; - } - self.rightInputToolbarButton.enabled = NO; - } - } -} - -- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height -{ - // Update growing text's superview (toolbar view) - CGFloat updatedHeight = height + (self.messageComposerContainerTopConstraint.constant + self.messageComposerContainerBottomConstraint.constant); - if ([self.delegate respondsToSelector:@selector(roomInputToolbarView:heightDidChanged:completion:)]) - { - [self.delegate roomInputToolbarView:self heightDidChanged:updatedHeight completion:nil]; - } -} - -- (BOOL)growingTextView:(HPGrowingTextView *)growingTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text -{ - return self.isEditable; -} - -@end diff --git a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.xib b/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.xib deleted file mode 100644 index 3f4117499..000000000 --- a/Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarViewWithHPGrowingText.xib +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Riot/Modules/Onboarding/OnboardingCoordinatorBridgePresenter.swift b/Riot/Modules/Onboarding/OnboardingCoordinatorBridgePresenter.swift index 9cc43c1b1..32f433936 100644 --- a/Riot/Modules/Onboarding/OnboardingCoordinatorBridgePresenter.swift +++ b/Riot/Modules/Onboarding/OnboardingCoordinatorBridgePresenter.swift @@ -28,7 +28,8 @@ class OnboardingCoordinatorBridgePresenterParameters: NSObject { /// OnboardingCoordinatorBridgePresenter enables to start OnboardingCoordinator from a view controller. /// This bridge is used while waiting for global usage of coordinator pattern. -/// **WARNING**: This class breaks the Coordinator abstraction and it has been introduced for **Objective-C compatibility only** (mainly for integration in legacy view controllers). Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator. +/// **WARNING**: This class breaks the Coordinator abstraction and it has been introduced for **Objective-C compatibility only** (mainly for integration in legacy view controllers). Each bridge should be removed +/// once the underlying Coordinator has been integrated by another Coordinator. @objcMembers final class OnboardingCoordinatorBridgePresenter: NSObject { diff --git a/Riot/Modules/Room/EditHistory/EditHistoryCoordinatorBridgePresenter.swift b/Riot/Modules/Room/EditHistory/EditHistoryCoordinatorBridgePresenter.swift index 1e0dab2f8..b908e5cb0 100644 --- a/Riot/Modules/Room/EditHistory/EditHistoryCoordinatorBridgePresenter.swift +++ b/Riot/Modules/Room/EditHistory/EditHistoryCoordinatorBridgePresenter.swift @@ -58,7 +58,6 @@ final class EditHistoryCoordinatorBridgePresenter: NSObject { func present(from viewController: UIViewController, animated: Bool) { guard let formatter = self.createEventFormatter(session: self.session) else { - //s das return } diff --git a/Riot/Modules/Room/EmojiPicker/EmojiPickerViewController.swift b/Riot/Modules/Room/EmojiPicker/EmojiPickerViewController.swift index 47349e326..b9d2beb85 100644 --- a/Riot/Modules/Room/EmojiPicker/EmojiPickerViewController.swift +++ b/Riot/Modules/Room/EmojiPicker/EmojiPickerViewController.swift @@ -164,7 +164,7 @@ final class EmojiPickerViewController: UIViewController { private func setupSearchController() { let searchController = UISearchController(searchResultsController: nil) - searchController.dimsBackgroundDuringPresentation = false + searchController.obscuresBackgroundDuringPresentation = false searchController.searchResultsUpdater = self searchController.searchBar.placeholder = VectorL10n.searchDefaultPlaceholder searchController.hidesNavigationBarDuringPresentation = false diff --git a/Riot/Modules/Room/MXKRoomViewController.m b/Riot/Modules/Room/MXKRoomViewController.m index 0028f45f3..702802342 100644 --- a/Riot/Modules/Room/MXKRoomViewController.m +++ b/Riot/Modules/Room/MXKRoomViewController.m @@ -228,6 +228,8 @@ [[[self class] nib] instantiateWithOwner:self options:nil]; } + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" // Adjust bottom constraint of the input toolbar container in order to take into account potential tabBar _roomInputToolbarContainerBottomConstraint.active = NO; _roomInputToolbarContainerBottomConstraint = [NSLayoutConstraint constraintWithItem:self.bottomLayoutGuide @@ -237,6 +239,8 @@ attribute:NSLayoutAttributeBottom multiplier:1.0f constant:0.0f]; + #pragma clang diagnostic pop + _roomInputToolbarContainerBottomConstraint.active = YES; [self.view setNeedsUpdateConstraints]; @@ -419,6 +423,8 @@ }); } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" // The 2 following methods are deprecated since iOS 8 - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { @@ -446,6 +452,7 @@ self->isSizeTransitionInProgress = NO; }); } +#pragma clang diagnostic pop - (void)viewDidLayoutSubviews { @@ -488,6 +495,8 @@ self.keyboardView = keyboardView; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" - (void)setKeyboardHeight:(CGFloat)keyboardHeight { // Deduce the bottom constraint for the input toolbar view (Don't forget the potential tabBar) @@ -531,6 +540,7 @@ super.keyboardHeight = keyboardHeight; } +#pragma clang diagnostic pop - (void)destroy { @@ -1046,7 +1056,7 @@ [titleView destroy]; } - titleView = self.navigationItem.titleView = [roomTitleViewClass roomTitleView]; + self.navigationItem.titleView = titleView = [roomTitleViewClass roomTitleView]; titleView.delegate = self; // Define directly the navigation titleView with the custom title view instance. Do not use anymore a container. @@ -2116,6 +2126,8 @@ self->eventDetailsView = eventDetailsView; + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" [self.view addConstraint:[NSLayoutConstraint constraintWithItem:eventDetailsView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual @@ -2131,6 +2143,7 @@ attribute:NSLayoutAttributeTop multiplier:1.0f constant:-10.0f]]; + #pragma clang diagnostic pop [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.view attribute:NSLayoutAttributeLeading diff --git a/Riot/Modules/Room/Members/RoomParticipantsViewController.m b/Riot/Modules/Room/Members/RoomParticipantsViewController.m index 0c8cee07f..bdf4465b6 100644 --- a/Riot/Modules/Room/Members/RoomParticipantsViewController.m +++ b/Riot/Modules/Room/Members/RoomParticipantsViewController.m @@ -102,6 +102,8 @@ // Adjust Top and Bottom constraints to take into account potential navBar and tabBar. [NSLayoutConstraint deactivateConstraints:@[_searchBarTopConstraint]]; + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" _searchBarTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual @@ -109,6 +111,7 @@ attribute:NSLayoutAttributeTop multiplier:1.0f constant:0.0f]; + #pragma clang diagnostic pop [NSLayoutConstraint activateConstraints:@[_searchBarTopConstraint]]; @@ -850,7 +853,7 @@ pendingMaskSpinnerView.alpha = 0; [UIView animateWithDuration:0.3 delay:0.3 options:UIViewAnimationOptionBeginFromCurrentState animations:^{ - pendingMaskSpinnerView.alpha = 1; + self->pendingMaskSpinnerView.alpha = 1; } completion:^(BOOL finished) { }]; diff --git a/Riot/Modules/Room/RoomCoordinatorBridgePresenter.swift b/Riot/Modules/Room/RoomCoordinatorBridgePresenter.swift index bd6b70d77..017b8b6e8 100644 --- a/Riot/Modules/Room/RoomCoordinatorBridgePresenter.swift +++ b/Riot/Modules/Room/RoomCoordinatorBridgePresenter.swift @@ -62,7 +62,8 @@ class RoomCoordinatorBridgePresenterParameters: NSObject { /// RoomCoordinatorBridgePresenter enables to start RoomCoordinator from a view controller. /// This bridge is used while waiting for global usage of coordinator pattern. -/// **WARNING**: This class breaks the Coordinator abstraction and it has been introduced for **Objective-C compatibility only** (mainly for integration in legacy view controllers). Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator. +/// **WARNING**: This class breaks the Coordinator abstraction and it has been introduced for **Objective-C compatibility only** (mainly for integration in legacy view controllers). Each bridge should be removed +/// once the underlying Coordinator has been integrated by another Coordinator. @objcMembers final class RoomCoordinatorBridgePresenter: NSObject { diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index ce081145f..d5f40da02 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -90,7 +90,7 @@ NSNotificationName const RoomCallTileTappedNotification = @"RoomCallTileTappedNo NSNotificationName const RoomGroupCallTileTappedNotification = @"RoomGroupCallTileTappedNotification"; const NSTimeInterval kResizeComposerAnimationDuration = .05; -@interface RoomViewController () @@ -2585,7 +2585,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; self.bubblesTableViewTopConstraint.constant = self.previewHeaderContainerHeightConstraint.constant - self.bubblesTableView.adjustedContentInset.top; - previewHeader.roomAvatar.alpha = 1; + self->previewHeader.roomAvatar.alpha = 1; // Force to render the view [self forceLayoutRefresh]; @@ -5735,6 +5735,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; self->encryptionInfoView = encryptionInfoView; + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated" [self.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual @@ -5750,6 +5752,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; attribute:NSLayoutAttributeTop multiplier:1.0f constant:-10.0f]]; + #pragma clang diagnostic pop [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.view attribute:NSLayoutAttributeLeading @@ -5829,19 +5832,19 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; [UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseIn animations:^{ - readMarkerTableViewCell.readMarkerViewLeadingConstraint.constant = readMarkerTableViewCell.readMarkerViewTrailingConstraint.constant = readMarkerTableViewCell.bubbleOverlayContainer.frame.size.width / 2; - readMarkerTableViewCell.readMarkerView.alpha = 0; + self->readMarkerTableViewCell.readMarkerViewLeadingConstraint.constant = self->readMarkerTableViewCell.readMarkerViewTrailingConstraint.constant = self->readMarkerTableViewCell.bubbleOverlayContainer.frame.size.width / 2; + self->readMarkerTableViewCell.readMarkerView.alpha = 0; // Force to render the view - [readMarkerTableViewCell.bubbleOverlayContainer layoutIfNeeded]; + [self->readMarkerTableViewCell.bubbleOverlayContainer layoutIfNeeded]; } completion:^(BOOL finished){ - readMarkerTableViewCell.readMarkerView.hidden = YES; - readMarkerTableViewCell.readMarkerView.alpha = 1; + self->readMarkerTableViewCell.readMarkerView.hidden = YES; + self->readMarkerTableViewCell.readMarkerView.alpha = 1; - readMarkerTableViewCell = nil; + self->readMarkerTableViewCell = nil; }]; }); diff --git a/Riot/Modules/Room/Search/RoomSearchViewController.m b/Riot/Modules/Room/Search/RoomSearchViewController.m index 7d830ecb3..8097ca2b0 100644 --- a/Riot/Modules/Room/Search/RoomSearchViewController.m +++ b/Riot/Modules/Room/Search/RoomSearchViewController.m @@ -352,8 +352,8 @@ // Do it asynchronously to give time to messagesSearchViewController to be set up // so that it can display its loading wheel dispatch_async(dispatch_get_main_queue(), ^{ - [messagesSearchDataSource searchMessages:self.searchBar.text force:NO]; - messagesSearchViewController.shouldScrollToBottomOnRefresh = YES; + [self->messagesSearchDataSource searchMessages:self.searchBar.text force:NO]; + self->messagesSearchViewController.shouldScrollToBottomOnRefresh = YES; }); } } @@ -365,8 +365,8 @@ // Do it asynchronously to give time to filesSearchViewController to be set up // so that it can display its loading wheel dispatch_async(dispatch_get_main_queue(), ^{ - [filesSearchDataSource searchMessages:self.searchBar.text force:NO]; - filesSearchViewController.shouldScrollToBottomOnRefresh = YES; + [self->filesSearchDataSource searchMessages:self.searchBar.text force:NO]; + self->filesSearchViewController.shouldScrollToBottomOnRefresh = YES; }); } } diff --git a/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m b/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m index cb15df862..f32e4cc68 100644 --- a/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m +++ b/Riot/Modules/Room/Views/Activities/RoomActivitiesView.m @@ -484,6 +484,8 @@ #pragma mark - UITextViewDelegate +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange { if ([[URL absoluteString] isEqualToString:@"onResendLink"]) @@ -559,6 +561,7 @@ return YES; } +#pragma clang diagnostic pop #pragma mark - UIGestureRecognizerDelegate diff --git a/Riot/Modules/Room/Views/BubbleCells/Common/MXKRoomBubbleTableViewCell.m b/Riot/Modules/Room/Views/BubbleCells/Common/MXKRoomBubbleTableViewCell.m index b0a2fba49..555733c7f 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Common/MXKRoomBubbleTableViewCell.m +++ b/Riot/Modules/Room/Views/BubbleCells/Common/MXKRoomBubbleTableViewCell.m @@ -1549,6 +1549,8 @@ static NSMutableDictionary *childClasses; return shouldInteractWithURL; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" // Delegate method only called on iOS 9. iOS 10+ use method above. - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange { @@ -1571,6 +1573,7 @@ static NSMutableDictionary *childClasses; return shouldInteractWithURL; } +#pragma clang diagnostic pop #pragma mark - WKNavigationDelegate diff --git a/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.m b/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.m index a5bf789d6..91f62a8d6 100644 --- a/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.m +++ b/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.m @@ -92,7 +92,7 @@ // Accept the received requests from this device [self.mxSession.crypto acceptAllPendingKeyRequestsFromUser:self.device.userId andDevice:self.device.deviceId onComplete:^{ - onComplete(); + self->onComplete(); }]; } }]]; @@ -110,7 +110,7 @@ // Ignore all pending requests from this device [self.mxSession.crypto ignoreAllPendingKeyRequestsFromUser:self.device.userId andDevice:self.device.deviceId onComplete:^{ - onComplete(); + self->onComplete(); }]; } }]]; @@ -169,7 +169,7 @@ // As the device is now verified, all other key requests will be automatically accepted. [self.mxSession.crypto acceptAllPendingKeyRequestsFromUser:self.device.userId andDevice:self.device.deviceId onComplete:^{ - onComplete(); + self->onComplete(); }]; } else diff --git a/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift b/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift index 911f08302..23b48397e 100644 --- a/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift +++ b/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift @@ -103,7 +103,7 @@ final class SecretsRecoveryWithKeyViewController: UIViewController { switch self.viewModel.recoveryGoal { case .default, .keyBackup, .restoreSecureBackup: informationText = VectorL10n.secretsRecoveryWithKeyInformationDefault - case .unlockSecureBackup(_): + case .unlockSecureBackup: informationText = VectorL10n.secretsRecoveryWithKeyInformationUnlockSecureBackupWithKey case .verifyDevice: informationText = VectorL10n.secretsRecoveryWithKeyInformationVerifyDevice diff --git a/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift b/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift index 5c64fd51b..0578f2b37 100644 --- a/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift +++ b/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift @@ -106,7 +106,7 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController { switch self.viewModel.recoveryGoal { case .default, .keyBackup, .restoreSecureBackup: informationText = VectorL10n.secretsRecoveryWithPassphraseInformationDefault - case .unlockSecureBackup(_): + case .unlockSecureBackup: informationText = VectorL10n.secretsRecoveryWithKeyInformationUnlockSecureBackupWithPhrase case .verifyDevice: informationText = VectorL10n.secretsRecoveryWithPassphraseInformationVerifyDevice diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index d009b7b6e..a1964925e 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -258,7 +258,9 @@ TableViewSectionsDelegate> @property (nonatomic) UNNotificationSettings *systemNotificationSettings; @property (nonatomic, weak) DeactivateAccountViewController *deactivateAccountViewController; + @property (nonatomic, strong) NotificationSettingsCoordinatorBridgePresenter *notificationSettingsBridgePresenter; + @property (nonatomic, strong) SignOutAlertPresenter *signOutAlertPresenter; @property (nonatomic, weak) UIButton *signOutButton; @property (nonatomic, strong) SingleImagePickerPresenter *imagePickerPresenter; diff --git a/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewController.swift b/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewController.swift index 60c942176..bbd8b5a90 100644 --- a/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewController.swift +++ b/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewController.swift @@ -219,7 +219,11 @@ class SpaceDetailViewController: UIViewController { self.inviterPanelHeight.constant = 0 } - let avatarViewData = AvatarViewData(matrixItemId: parameters.spaceId, displayName: parameters.displayName, avatarUrl: parameters.avatarUrl, mediaManager: self.mediaManager, fallbackImage: .matrixItem(parameters.spaceId, parameters.displayName)) + let avatarViewData = AvatarViewData(matrixItemId: parameters.spaceId, + displayName: parameters.displayName, + avatarUrl: parameters.avatarUrl, + mediaManager: self.mediaManager, + fallbackImage: .matrixItem(parameters.spaceId, parameters.displayName)) self.titleLabel.text = parameters.displayName self.avatarView.fill(with: avatarViewData) diff --git a/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewModel.swift b/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewModel.swift index 46bb2b1f1..df57aeba0 100644 --- a/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewModel.swift +++ b/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewModel.swift @@ -76,14 +76,30 @@ class SpaceDetailViewModel: SpaceDetailViewModelType { private func loadData() { if let publicRoom = self.publicRoom { - self.update(viewState: .loaded(SpaceDetailLoadedParameters(spaceId: publicRoom.roomId, displayName: publicRoom.displayname(), topic: publicRoom.topic, avatarUrl: publicRoom.avatarUrl, joinRule: publicRoom.worldReadable ? .public : .private, membership: .unknown, inviterId: nil, inviter: nil, membersCount: UInt(publicRoom.numJoinedMembers)))) + self.update(viewState: .loaded(SpaceDetailLoadedParameters(spaceId: publicRoom.roomId, + displayName: publicRoom.displayname(), + topic: publicRoom.topic, + avatarUrl: publicRoom.avatarUrl, + joinRule: publicRoom.worldReadable ? .public : .private, + membership: .unknown, + inviterId: nil, + inviter: nil, + membersCount: UInt(publicRoom.numJoinedMembers)))) } else { guard let space = self.session.spaceService.getSpace(withId: self.spaceId), let summary = space.summary else { MXLog.error("[SpaceDetailViewModel] setupViews: no space found") return } - let parameters = SpaceDetailLoadedParameters(spaceId: space.spaceId, displayName: summary.displayname, topic: summary.topic, avatarUrl: summary.avatar, joinRule: nil, membership: summary.membership, inviterId: nil, inviter: nil, membersCount: 0) + let parameters = SpaceDetailLoadedParameters(spaceId: space.spaceId, + displayName: summary.displayname, + topic: summary.topic, + avatarUrl: summary.avatar, + joinRule: nil, + membership: summary.membership, + inviterId: nil, + inviter: nil, + membersCount: 0) self.update(viewState: .loaded(parameters)) self.update(viewState: .loading) @@ -103,7 +119,15 @@ class SpaceDetailViewModel: SpaceDetailViewModelType { } }) - let parameters = SpaceDetailLoadedParameters(spaceId: space.spaceId, displayName: summary.displayname, topic: summary.topic, avatarUrl: summary.avatar, joinRule: joinRule, membership: summary.membership, inviterId: inviterId, inviter: inviter, membersCount: membersCount) + let parameters = SpaceDetailLoadedParameters(spaceId: space.spaceId, + displayName: summary.displayname, + topic: summary.topic, + avatarUrl: summary.avatar, + joinRule: joinRule, + membership: summary.membership, + inviterId: inviterId, + inviter: inviter, + membersCount: membersCount) self.update(viewState: .loaded(parameters)) } } diff --git a/Riot/Modules/Spaces/SpaceList/SpaceListViewModel.swift b/Riot/Modules/Spaces/SpaceList/SpaceListViewModel.swift index 62770e05e..4d82d8368 100644 --- a/Riot/Modules/Spaces/SpaceList/SpaceListViewModel.swift +++ b/Riot/Modules/Spaces/SpaceList/SpaceListViewModel.swift @@ -204,7 +204,11 @@ final class SpaceListViewModel: SpaceListViewModelType { let homeNotificationState = session.spaceService.notificationCounter.homeNotificationState let homeViewData = SpaceListItemViewData(spaceId: Constants.homeSpaceId, - title: VectorL10n.spacesHomeSpaceTitle, avatarViewData: avatarViewData, isInvite: false, notificationCount: homeNotificationState.allCount, highlightedNotificationCount: homeNotificationState.allHighlightCount) + title: VectorL10n.spacesHomeSpaceTitle, + avatarViewData: avatarViewData, + isInvite: false, + notificationCount: homeNotificationState.allCount, + highlightedNotificationCount: homeNotificationState.allHighlightCount) return homeViewData } @@ -214,7 +218,11 @@ final class SpaceListViewModel: SpaceListViewModelType { session.spaceService.rootSpaceSummaries.forEach { summary in let avatarViewData = AvatarViewData(matrixItemId: summary.roomId, displayName: summary.displayname, avatarUrl: summary.avatar, mediaManager: session.mediaManager, fallbackImage: .matrixItem(summary.roomId, summary.displayname)) let notificationState = session.spaceService.notificationCounter.notificationState(forSpaceWithId: summary.roomId) - let viewData = SpaceListItemViewData(spaceId: summary.roomId, title: summary.displayname, avatarViewData: avatarViewData, isInvite: summary.membership == .invite, notificationCount: notificationState?.groupMissedDiscussionsCount ?? 0, highlightedNotificationCount: notificationState?.groupMissedDiscussionsHighlightedCount ?? 0) + let viewData = SpaceListItemViewData(spaceId: summary.roomId, title: summary.displayname, + avatarViewData: avatarViewData, + isInvite: summary.membership == .invite, + notificationCount: notificationState?.groupMissedDiscussionsCount ?? 0, + highlightedNotificationCount: notificationState?.groupMissedDiscussionsHighlightedCount ?? 0) if viewData.isInvite { invites.append(viewData) } else { diff --git a/Riot/Modules/Spaces/SpaceMembers/SpaceMembersCoordinatorBridgePresenter.swift b/Riot/Modules/Spaces/SpaceMembers/SpaceMembersCoordinatorBridgePresenter.swift index 7b4ea93c6..056a591b1 100644 --- a/Riot/Modules/Spaces/SpaceMembers/SpaceMembersCoordinatorBridgePresenter.swift +++ b/Riot/Modules/Spaces/SpaceMembers/SpaceMembersCoordinatorBridgePresenter.swift @@ -24,7 +24,8 @@ import Foundation /// SpaceMembersCoordinatorBridgePresenter enables to start SpaceMemberListCoordinator from a view controller. /// This bridge is used while waiting for global usage of coordinator pattern. -/// It breaks the Coordinator abstraction and it has been introduced for Objective-C compatibility (mainly for integration in legacy view controllers). Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator. +/// It breaks the Coordinator abstraction and it has been introduced for Objective-C compatibility (mainly for integration in legacy view controllers). +/// Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator. @objcMembers final class SpaceMembersCoordinatorBridgePresenter: NSObject { diff --git a/Riot/Modules/Spaces/SpaceRoomList/ExploreRoomCoordinatorBridgePresenter.swift b/Riot/Modules/Spaces/SpaceRoomList/ExploreRoomCoordinatorBridgePresenter.swift index 824801fb4..bbbcedfac 100644 --- a/Riot/Modules/Spaces/SpaceRoomList/ExploreRoomCoordinatorBridgePresenter.swift +++ b/Riot/Modules/Spaces/SpaceRoomList/ExploreRoomCoordinatorBridgePresenter.swift @@ -24,7 +24,8 @@ import Foundation /// ExploreRoomCoordinatorBridgePresenter enables to start ExploreRoomCoordinator from a view controller. /// This bridge is used while waiting for global usage of coordinator pattern. -/// It breaks the Coordinator abstraction and it has been introduced for Objective-C compatibility (mainly for integration in legacy view controllers). Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator. +/// It breaks the Coordinator abstraction and it has been introduced for Objective-C compatibility (mainly for integration in legacy view controllers). Each bridge should be removed once the underlying Coordinator has +/// been integrated by another Coordinator. @objcMembers final class ExploreRoomCoordinatorBridgePresenter: NSObject { diff --git a/Riot/Modules/Spaces/SpaceRoomList/SpaceChildRoomDetail/SpaceChildRoomDetailViewModel.swift b/Riot/Modules/Spaces/SpaceRoomList/SpaceChildRoomDetail/SpaceChildRoomDetailViewModel.swift index 299c42d4a..c5989e23b 100644 --- a/Riot/Modules/Spaces/SpaceRoomList/SpaceChildRoomDetail/SpaceChildRoomDetailViewModel.swift +++ b/Riot/Modules/Spaces/SpaceRoomList/SpaceChildRoomDetail/SpaceChildRoomDetailViewModel.swift @@ -71,7 +71,11 @@ final class SpaceChildRoomDetailViewModel: SpaceChildRoomDetailViewModelType { // MARK: - Private private func loadData() { - let avatarViewData = AvatarViewData(matrixItemId: self.childInfo.childRoomId, displayName: self.childInfo.displayName, avatarUrl: self.childInfo.avatarUrl, mediaManager: self.session.mediaManager, fallbackImage: .matrixItem(self.childInfo.childRoomId, self.childInfo.name)) + let avatarViewData = AvatarViewData(matrixItemId: self.childInfo.childRoomId, + displayName: self.childInfo.displayName, + avatarUrl: self.childInfo.avatarUrl, + mediaManager: self.session.mediaManager, + fallbackImage: .matrixItem(self.childInfo.childRoomId, self.childInfo.name)) self.update(viewState: .loaded(self.childInfo, avatarViewData, self.isRoomJoined)) } diff --git a/Riot/Modules/SplitView/SplitViewCoordinator.swift b/Riot/Modules/SplitView/SplitViewCoordinator.swift index 442da486e..2157cbd31 100644 --- a/Riot/Modules/SplitView/SplitViewCoordinator.swift +++ b/Riot/Modules/SplitView/SplitViewCoordinator.swift @@ -266,7 +266,8 @@ extension SplitViewCoordinator: UISplitViewControllerDelegate { func splitViewController(_ splitViewController: UISplitViewController, separateSecondaryFrom primaryViewController: UIViewController) -> UIViewController? { // If the primary root controller of the UISplitViewController is a UINavigationController, - // it's possible to have nested navigation controllers due to private property `_allowNestedNavigationControllers` set to true (https://blog.malcolmhall.com/2017/01/27/default-behaviour-of-uisplitviewcontroller-collapsesecondaryviewcontroller/). + // it's possible to have nested navigation controllers due to private property `_allowNestedNavigationControllers` set to true + // (https://blog.malcolmhall.com/2017/01/27/default-behaviour-of-uisplitviewcontroller-collapsesecondaryviewcontroller/). // So if the top view controller of the primary navigation controller is a navigation controller and it corresponds to the existing `detailNavigationController` instance. // Return `detailNavigationController` as is, it will be used as the secondary view of the split view controller. if let topMostNavigationController = self.selectedNavigationRouter?.modules.last as? UINavigationController, topMostNavigationController == self.detailNavigationController { @@ -302,7 +303,8 @@ extension SplitViewCoordinator: UISplitViewControllerDelegate { // Return false to let the split view controller try to incorporate the secondary view controller's content into the collapsed interface. // If the primary root controller of a UISplitViewController is a UINavigationController, - // it's possible to have nested navigation controllers due to private property `_allowNestedNavigationControllers` set to true (https://blog.malcolmhall.com/2017/01/27/default-behaviour-of-uisplitviewcontroller-collapsesecondaryviewcontroller/). + // it's possible to have nested navigation controllers due to private property `_allowNestedNavigationControllers` set to true + // (https://blog.malcolmhall.com/2017/01/27/default-behaviour-of-uisplitviewcontroller-collapsesecondaryviewcontroller/). // So in this case returning false here will push the `detailNavigationController` on top of the `primaryNavigationController`. // Sample primary view stack: // primaryNavigationController[ @@ -344,7 +346,8 @@ extension SplitViewCoordinator: SplitViewMasterPresentableDelegate { // - If the split view controller is collpased (one column visible): // The `detailNavigationController` will be pushed on top of the primary navigation controller. // In fact if the primary root controller of a UISplitViewController is a UINavigationController, - // it's possible to have nested navigation controllers due to private property `_allowNestedNavigationControllers` set to true (https://blog.malcolmhall.com/2017/01/27/default-behaviour-of-uisplitviewcontroller-collapsesecondaryviewcontroller/). + // it's possible to have nested navigation controllers due to private property `_allowNestedNavigationControllers` set to true + // (https://blog.malcolmhall.com/2017/01/27/default-behaviour-of-uisplitviewcontroller-collapsesecondaryviewcontroller/). // - Else if the split view controller is not collpased (two column visible) // It will set the `detailNavigationController` as the secondary view of the split view controller self.splitViewController.showDetailViewController(detailNavigationController, sender: nil) diff --git a/Riot/Modules/TabBar/MasterTabBarController.m b/Riot/Modules/TabBar/MasterTabBarController.m index 9b01d88d3..5484b0c2f 100644 --- a/Riot/Modules/TabBar/MasterTabBarController.m +++ b/Riot/Modules/TabBar/MasterTabBarController.m @@ -531,7 +531,8 @@ self.addAccountObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKAccountManagerDidAddAccountNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { MXStrongifyAndReturnIfNil(self); -#warning What was this doing? This should probably happen elsewhere + + // What was this doing? This should probably happen elsewhere // self.onboardingCoordinatorBridgePresenter = nil; [[NSNotificationCenter defaultCenter] removeObserver:self.addAccountObserver]; @@ -541,7 +542,8 @@ self.removeAccountObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKAccountManagerDidRemoveAccountNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { MXStrongifyAndReturnIfNil(self); // The user has cleared data for their soft logged out account -#warning What was this doing? This should probably happen elsewhere + + // What was this doing? This should probably happen elsewhere // self.onboardingCoordinatorBridgePresenter = nil; [[NSNotificationCenter defaultCenter] removeObserver:self.removeAccountObserver]; diff --git a/Riot/Modules/Threads/ThreadsCoordinatorBridgePresenter.swift b/Riot/Modules/Threads/ThreadsCoordinatorBridgePresenter.swift index 43879b292..2fb6fc14b 100644 --- a/Riot/Modules/Threads/ThreadsCoordinatorBridgePresenter.swift +++ b/Riot/Modules/Threads/ThreadsCoordinatorBridgePresenter.swift @@ -28,7 +28,8 @@ import Foundation /// ThreadsCoordinatorBridgePresenter enables to start ThreadsCoordinator from a view controller. /// This bridge is used while waiting for global usage of coordinator pattern. -/// **WARNING**: This class breaks the Coordinator abstraction and it has been introduced for **Objective-C compatibility only** (mainly for integration in legacy view controllers). Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator. +/// **WARNING**: This class breaks the Coordinator abstraction and it has been introduced for **Objective-C compatibility only** (mainly for integration in legacy view controllers). Each bridge should be removed +/// once the underlying Coordinator has been integrated by another Coordinator. @objcMembers final class ThreadsCoordinatorBridgePresenter: NSObject { diff --git a/Riot/Modules/UserDevices/UsersDevicesViewController.m b/Riot/Modules/UserDevices/UsersDevicesViewController.m index 308f0afcd..6e2145c4c 100644 --- a/Riot/Modules/UserDevices/UsersDevicesViewController.m +++ b/Riot/Modules/UserDevices/UsersDevicesViewController.m @@ -279,9 +279,9 @@ [self stopActivityIndicator]; [self dismissViewControllerAnimated:YES completion:nil]; - if (onCompleteBlock) + if (self->onCompleteBlock) { - onCompleteBlock(YES); + self->onCompleteBlock(YES); } }]; } diff --git a/Riot/Utils/EventFormatter.m b/Riot/Utils/EventFormatter.m index efb79d40e..32c0eaf1f 100644 --- a/Riot/Utils/EventFormatter.m +++ b/Riot/Utils/EventFormatter.m @@ -247,7 +247,7 @@ static NSString *const kEventFormatterTimeFormat = @"HH:mm"; { // Track e2e failures dispatch_async(dispatch_get_main_queue(), ^{ - [[DecryptionFailureTracker sharedInstance] reportUnableToDecryptErrorForEvent:event withRoomState:roomState myUser:mxSession.myUser.userId]; + [[DecryptionFailureTracker sharedInstance] reportUnableToDecryptErrorForEvent:event withRoomState:roomState myUser:self->mxSession.myUser.userId]; }); if (event.decryptionError.code == MXDecryptingErrorUnknownInboundSessionIdCode) diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index 0cba64e18..533d35549 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -396,7 +396,7 @@ class NotificationService: UNNotificationServiceExtension { } if !isHighlighted { - #warning("In practice, this only hides the notification's content. An empty notification may be less useful in this instance?") + // In practice, this only hides the notification's content. An empty notification may be less useful in this instance? // Ignore this notif. MXLog.debug("[NotificationService] notificationContentForEvent: Ignore non highlighted notif in mentions only room") onComplete(nil, false) diff --git a/changelog.d/pr-5513.misc b/changelog.d/pr-5513.misc new file mode 100644 index 000000000..f39615d48 --- /dev/null +++ b/changelog.d/pr-5513.misc @@ -0,0 +1 @@ +Fixed or ignored various project warnings for better DevX \ No newline at end of file