mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
ContactsTableViewController: Prevent retain cycles.
This commit is contained in:
parent
a05c488ed6
commit
222db3c02d
2 changed files with 11 additions and 3 deletions
|
@ -122,7 +122,7 @@
|
|||
/**
|
||||
The delegate for the view controller.
|
||||
*/
|
||||
@property (nonatomic) id<ContactsTableViewControllerDelegate> contactsTableViewControllerDelegate;
|
||||
@property (nonatomic, weak) id<ContactsTableViewControllerDelegate> contactsTableViewControllerDelegate;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
/**
|
||||
Observe kAppDelegateDidTapStatusBarNotification to handle tap on clock status bar.
|
||||
*/
|
||||
id kAppDelegateDidTapStatusBarNotificationObserver;
|
||||
__weak id kAppDelegateDidTapStatusBarNotificationObserver;
|
||||
|
||||
/**
|
||||
Observe kThemeServiceDidChangeThemeNotification to handle user interface theme change.
|
||||
*/
|
||||
id kThemeServiceDidChangeThemeNotificationObserver;
|
||||
__weak id kThemeServiceDidChangeThemeNotificationObserver;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) FindYourContactsFooterView *findYourContactsFooterView;
|
||||
|
@ -102,9 +102,13 @@
|
|||
self.contactsTableView.tableFooterView = [[UIView alloc] init];
|
||||
self.contactsAreFilteredWithSearch = NO;
|
||||
|
||||
MXWeakify(self);
|
||||
|
||||
// Observe user interface theme change.
|
||||
kThemeServiceDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kThemeServiceDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
|
||||
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
[self userInterfaceThemeDidChange];
|
||||
|
||||
}];
|
||||
|
@ -158,10 +162,14 @@
|
|||
|
||||
// Screen tracking
|
||||
[[Analytics sharedInstance] trackScreen:_screenName];
|
||||
|
||||
MXWeakify(self);
|
||||
|
||||
// Observe kAppDelegateDidTapStatusBarNotification.
|
||||
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
|
||||
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
[self.contactsTableView setContentOffset:CGPointMake(-self.contactsTableView.adjustedContentInset.left, -self.contactsTableView.adjustedContentInset.top) animated:YES];
|
||||
|
||||
}];
|
||||
|
|
Loading…
Reference in a new issue