diff --git a/Riot/Modules/Common/Recents/RecentsViewController.h b/Riot/Modules/Common/Recents/RecentsViewController.h index b0c993f1e..6a475073a 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.h +++ b/Riot/Modules/Common/Recents/RecentsViewController.h @@ -40,7 +40,7 @@ FOUNDATION_EXPORT NSString *const RecentsViewControllerDataReadyNotification; /** Current alert (if any). */ - UIAlertController *currentAlert; + __weak UIAlertController *currentAlert; /** The list of the section headers currently displayed in the recents table. diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 063f37ff7..56ab95084 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -2353,11 +2353,14 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; if (isVisible) { - previewHeader = [PreviewRoomTitleView roomTitleView]; + PreviewRoomTitleView *previewHeader = [PreviewRoomTitleView roomTitleView]; previewHeader.delegate = self; previewHeader.tapGestureDelegate = self; previewHeader.translatesAutoresizingMaskIntoConstraints = NO; [self.previewHeaderContainer addSubview:previewHeader]; + + self->previewHeader = previewHeader; + // Force preview header in full width NSLayoutConstraint *leftConstraint = [NSLayoutConstraint constraintWithItem:previewHeader attribute:NSLayoutAttributeLeading @@ -5398,7 +5401,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; // Remove potential existing subviews [self dismissTemporarySubViews]; - encryptionInfoView = [[EncryptionInfoView alloc] initWithEvent:event andMatrixSession:self.roomDataSource.mxSession]; + EncryptionInfoView *encryptionInfoView = [[EncryptionInfoView alloc] initWithEvent:event andMatrixSession:self.roomDataSource.mxSession]; // Add shadow on added view encryptionInfoView.layer.cornerRadius = 5; @@ -5408,6 +5411,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; // Add the view and define edge constraints [self.view addSubview:encryptionInfoView]; + self->encryptionInfoView = encryptionInfoView; + [self.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual