Fixed various project warnings. Completely disabled nullability checks, went down from ~20k to 195.

This commit is contained in:
Stefan Ceriu 2022-02-07 14:26:47 +02:00 committed by Stefan Ceriu
parent 850cad4c23
commit 4bd5c12f73
85 changed files with 465 additions and 679 deletions

View file

@ -36,7 +36,7 @@ line_length:
error: 1000
file_length:
warning: 700
warning: 800
error: 1000
type_body_length:

View file

@ -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",

View file

@ -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

View file

@ -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

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="H1p-Uh-vWS">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="H1p-Uh-vWS">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@ -46,24 +46,6 @@
</objects>
<point key="canvasLocation" x="-153" y="-419"/>
</scene>
<!--Room Member Details View Controller-->
<scene sceneID="eq5-qi-gDd">
<objects>
<viewController id="nDS-pp-sWM" customClass="RoomMemberDetailsViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="AgI-3V-llt"/>
<viewControllerLayoutGuide type="bottom" id="6ie-9b-cBo"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="N8z-LO-417">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="e8Z-uW-oDv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="5047" y="-1437"/>
</scene>
<!--Room Search View Controller-->
<scene sceneID="rUg-1s-vHX">
<objects>
@ -116,14 +98,6 @@
</objects>
<point key="canvasLocation" x="2558" y="180"/>
</scene>
<!--Segmented View Controller-->
<scene sceneID="NZu-Q0-P0z">
<objects>
<tableViewController id="e7G-NU-7ck" customClass="SegmentedViewController" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="fXh-hO-Zgf" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3326" y="-442"/>
</scene>
<!--People View Controller-->
<scene sceneID="Qba-PP-lco">
<objects>
@ -501,24 +475,6 @@
</objects>
<point key="canvasLocation" x="1385" y="180"/>
</scene>
<!--Contacts Table View Controller-->
<scene sceneID="2zi-xJ-RQo">
<objects>
<viewController id="udm-55-AMb" customClass="ContactsTableViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Jch-ZS-1Mm"/>
<viewControllerLayoutGuide type="bottom" id="7q1-ig-sPp"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="6G9-nj-ktC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="uv3-zI-b3q" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="374" y="449"/>
</scene>
<!--Thread-->
<scene sceneID="Opl-gU-pwm">
<objects>

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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<MXKViewControllerActivityHandling> *homeViewController = (UIViewController<MXKViewControllerActivityHandling>*)_masterTabBarController.selectedViewController;
UIViewController<MXKViewControllerActivityHandling> *homeViewController = (UIViewController<MXKViewControllerActivityHandling>*)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;

View file

@ -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;

View file

@ -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)
{

View file

@ -219,7 +219,7 @@
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
inputsAlert = nil;
self->inputsAlert = nil;
}]];

View file

@ -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) {

View file

@ -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

View file

@ -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]

View file

@ -35,7 +35,7 @@
NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewControllerDataReadyNotification";
@interface RecentsViewController () <CreateRoomCoordinatorBridgePresenterDelegate, RoomsDirectoryCoordinatorBridgePresenterDelegate, RoomNotificationSettingsCoordinatorBridgePresenterDelegate>
@interface RecentsViewController () <CreateRoomCoordinatorBridgePresenterDelegate, RoomsDirectoryCoordinatorBridgePresenterDelegate, RoomNotificationSettingsCoordinatorBridgePresenterDelegate, DialpadViewControllerDelegate, ExploreRoomCoordinatorBridgePresenterDelegate>
{
// 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];
}];
}

View file

@ -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]];

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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];

View file

@ -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;

View file

@ -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);
}];
}

View file

@ -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;

View file

@ -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];

View file

@ -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

View file

@ -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;
});
}
}

View file

@ -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;

View file

@ -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()

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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
{

View file

@ -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;

View file

@ -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
{

View file

@ -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;

View file

@ -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
{

View file

@ -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
{

View file

@ -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
{

View file

@ -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]];

View file

@ -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 types 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)

View file

@ -69,7 +69,6 @@
#import "MXKRoomCreationView.h"
#import "MXKRoomInputToolbarView.h"
#import "MXKRoomInputToolbarViewWithHPGrowingText.h"
#import "MXKRoomDataSourceManager.h"

View file

@ -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<MXCredentials*> * _Nullable readData, void (^completion)(BOOL didUpdateCredentials)))readAnWriteHandler
{

View file

@ -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

View file

@ -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
{

View file

@ -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;

View file

@ -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
{

View file

@ -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

View file

@ -17,9 +17,6 @@
#import <UIKit/UIKit.h>
#define MXK_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#define MXK_DEPRECATED_ATTRIBUTE_WITH_MSG(msg) __attribute((deprecated((msg))))
/**
The Matrix iOS Kit version.
*/

View file

@ -24,7 +24,8 @@ import MobileCoreServices
/// MXKDocumentPickerPresenter presents a controller that provides access to documents or destinations outside the apps 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 {

View file

@ -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];
}
}];

View file

@ -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 {

View file

@ -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;

View file

@ -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;

View file

@ -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)
{

View file

@ -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 <HPGrowingTextView/HPGrowingTextView.h>
/**
`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 <HPGrowingTextViewDelegate>
{
@protected
HPGrowingTextView *growingTextView;
}
@end

View file

@ -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

View file

@ -1,85 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="MXKRoomInputToolbarViewWithHPGrowingText">
<rect key="frame" x="0.0" y="0.0" width="600" height="41"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="contactAdd" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hga-l8-Wua" userLabel="left Button">
<rect key="frame" x="8" y="0.0" width="35" height="41"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="35" id="ptO-BQ-NhS"/>
</constraints>
<state key="normal">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="onTouchUpInside:" destination="iN0-l3-epB" eventType="touchUpInside" id="jVG-We-DmS"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Owf-M8-qJi" userLabel="right Button">
<rect key="frame" x="552" y="0.0" width="44" height="41"/>
<constraints>
<constraint firstAttribute="width" constant="44" id="9FZ-CI-diT"/>
</constraints>
<state key="normal" title="Send">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="onTouchUpInside:" destination="iN0-l3-epB" eventType="touchUpInside" id="jed-Mz-rxe"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QWp-NV-uh5" userLabel="Message Composer Container">
<rect key="frame" x="51" y="4" width="497" height="33"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pkf-YH-tco" customClass="HPGrowingTextView">
<rect key="frame" x="0.0" y="0.0" width="497" height="33"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</subviews>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="pkf-YH-tco" secondAttribute="bottom" id="L3A-Oo-Ml2"/>
<constraint firstItem="pkf-YH-tco" firstAttribute="top" secondItem="QWp-NV-uh5" secondAttribute="top" id="VPn-k0-0vc"/>
<constraint firstItem="pkf-YH-tco" firstAttribute="leading" secondItem="QWp-NV-uh5" secondAttribute="leading" id="mXj-f3-DcT"/>
<constraint firstAttribute="trailing" secondItem="pkf-YH-tco" secondAttribute="trailing" id="n4K-Do-gHr"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="0.89720267057418823" green="0.89720267057418823" blue="0.89720267057418823" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="Owf-M8-qJi" secondAttribute="trailing" constant="4" id="2M8-Gu-0f6"/>
<constraint firstItem="QWp-NV-uh5" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="4" id="570-8j-VYY"/>
<constraint firstAttribute="bottom" secondItem="QWp-NV-uh5" secondAttribute="bottom" constant="4" id="9Ya-0H-03W"/>
<constraint firstItem="Hga-l8-Wua" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="8" id="Bc8-T7-wmA"/>
<constraint firstItem="Hga-l8-Wua" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="Cvk-xZ-ODy"/>
<constraint firstItem="Owf-M8-qJi" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="SV8-U3-8dd"/>
<constraint firstAttribute="bottom" secondItem="Hga-l8-Wua" secondAttribute="bottom" id="Slr-2H-laO"/>
<constraint firstItem="Owf-M8-qJi" firstAttribute="leading" secondItem="QWp-NV-uh5" secondAttribute="trailing" constant="4" id="UEd-gb-jgR"/>
<constraint firstItem="QWp-NV-uh5" firstAttribute="leading" secondItem="Hga-l8-Wua" secondAttribute="trailing" constant="8" id="cCr-Am-M7d"/>
<constraint firstAttribute="bottom" secondItem="Owf-M8-qJi" secondAttribute="bottom" id="ycc-x9-PAv"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="growingTextView" destination="pkf-YH-tco" id="VeP-WI-6Xh"/>
<outlet property="leftInputToolbarButton" destination="Hga-l8-Wua" id="zbm-3b-hoY"/>
<outlet property="messageComposerContainer" destination="QWp-NV-uh5" id="7EX-Un-ZIe"/>
<outlet property="messageComposerContainerBottomConstraint" destination="9Ya-0H-03W" id="226-iu-6tU"/>
<outlet property="messageComposerContainerTopConstraint" destination="570-8j-VYY" id="VKv-Qh-PCs"/>
<outlet property="rightInputToolbarButton" destination="Owf-M8-qJi" id="seO-ly-Bgg"/>
</connections>
</view>
</objects>
</document>

View file

@ -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 {

View file

@ -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
}

View file

@ -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

View file

@ -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

View file

@ -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) {
}];

View file

@ -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 {

View file

@ -90,7 +90,7 @@ NSNotificationName const RoomCallTileTappedNotification = @"RoomCallTileTappedNo
NSNotificationName const RoomGroupCallTileTappedNotification = @"RoomGroupCallTileTappedNotification";
const NSTimeInterval kResizeComposerAnimationDuration = .05;
@interface RoomViewController () <UISearchBarDelegate, UIGestureRecognizerDelegate, UIScrollViewAccessibilityDelegate, RoomTitleViewTapGestureDelegate, RoomParticipantsViewControllerDelegate, MXKRoomMemberDetailsViewControllerDelegate, ContactsTableViewControllerDelegate, MXServerNoticesDelegate, RoomContextualMenuViewControllerDelegate,
@interface RoomViewController () <UISearchBarDelegate, UIGestureRecognizerDelegate, UIScrollViewAccessibilityDelegate, RoomTitleViewTapGestureDelegate, MXKRoomMemberDetailsViewControllerDelegate, ContactsTableViewControllerDelegate, MXServerNoticesDelegate, RoomContextualMenuViewControllerDelegate,
ReactionsMenuViewModelCoordinatorDelegate, EditHistoryCoordinatorBridgePresenterDelegate, MXKDocumentPickerPresenterDelegate, EmojiPickerCoordinatorBridgePresenterDelegate,
ReactionHistoryCoordinatorBridgePresenterDelegate, CameraPresenterDelegate, MediaPickerCoordinatorBridgePresenterDelegate,
RoomDataSourceDelegate, RoomCreationModalCoordinatorBridgePresenterDelegate, RoomInfoCoordinatorBridgePresenterDelegate, DialpadViewControllerDelegate, RemoveJitsiWidgetViewDelegate, VoiceMessageControllerDelegate, SpaceDetailPresenterDelegate, UserSuggestionCoordinatorBridgeDelegate, ThreadsCoordinatorBridgePresenterDelegate, MXThreadingServiceDelegate>
@ -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;
}];
});

View file

@ -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;
});
}
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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)

View file

@ -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))
}
}

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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))
}

View file

@ -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)

View file

@ -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];

View file

@ -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 {

View file

@ -279,9 +279,9 @@
[self stopActivityIndicator];
[self dismissViewControllerAnimated:YES completion:nil];
if (onCompleteBlock)
if (self->onCompleteBlock)
{
onCompleteBlock(YES);
self->onCompleteBlock(YES);
}
}];
}

View file

@ -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)

View file

@ -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)

1
changelog.d/pr-5513.misc Normal file
View file

@ -0,0 +1 @@
Fixed or ignored various project warnings for better DevX