Update weak views usage.

This commit is contained in:
SBiOSoftWhare
2021-10-29 10:50:24 +02:00
parent b6614109a0
commit e6866a2e7f
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -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