MediaAlbumContentViewController: Fix some retain cycle issues.

This commit is contained in:
SBiOSoftWhare
2019-08-02 17:06:52 +02:00
parent 980990d5e3
commit 6082810908
2 changed files with 8 additions and 2 deletions
@@ -89,11 +89,15 @@
self.mediaTypes = @[(NSString *)kUTTypeImage];
}
MXWeakify(self);
// Observe UIApplicationWillEnterForegroundNotification to refresh captures collection when app leaves the background state.
UIApplicationWillEnterForegroundNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillEnterForegroundNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
MXStrongifyAndReturnIfNil(self);
// Force a full refresh of the displayed collection
self.assetsCollection = _assetsCollection;
self.assetsCollection = self->_assetsCollection;
}];
@@ -105,6 +109,8 @@
// Observe user interface theme change.
kThemeServiceDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kThemeServiceDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
MXStrongifyAndReturnIfNil(self);
[self userInterfaceThemeDidChange];
}];