@@ -1561,14 +1561,6 @@ - (void)slk_willShowOrHideTypeIndicatorView:(UIView <SLKTypingIndicatorProtocol>
15611561 }];
15621562}
15631563
1564- - (void )slk_willTerminateApplication : (NSNotification *)notification
1565- {
1566- // Caches the text before it's too late!
1567- if (self.isViewVisible ) {
1568- [self slk_cacheTextView ];
1569- }
1570- }
1571-
15721564
15731565#pragma mark - KVO Events
15741566
@@ -2237,8 +2229,9 @@ - (void)slk_registerNotifications
22372229 [notificationCenter addObserver: self selector: @selector (slk_didShakeTextView: ) name: SLKTextViewDidShakeNotification object: nil ];
22382230
22392231 // Application notifications
2240- [notificationCenter addObserver: self selector: @selector (slk_willTerminateApplication: ) name: UIApplicationWillTerminateNotification object: nil ];
2241- [notificationCenter addObserver: self selector: @selector (slk_willTerminateApplication: ) name: UIApplicationDidReceiveMemoryWarningNotification object: nil ];
2232+ [notificationCenter addObserver: self selector: @selector (slk_cacheTextView ) name: UIApplicationWillTerminateNotification object: nil ];
2233+ [notificationCenter addObserver: self selector: @selector (slk_cacheTextView ) name: UIApplicationDidEnterBackgroundNotification object: nil ];
2234+ [notificationCenter addObserver: self selector: @selector (slk_cacheTextView ) name: UIApplicationDidReceiveMemoryWarningNotification object: nil ];
22422235}
22432236
22442237- (void )slk_unregisterNotifications
@@ -2270,6 +2263,7 @@ - (void)slk_unregisterNotifications
22702263
22712264 // Application notifications
22722265 [notificationCenter removeObserver: self name: UIApplicationWillTerminateNotification object: nil ];
2266+ [notificationCenter removeObserver: self name: UIApplicationDidEnterBackgroundNotification object: nil ];
22732267 [notificationCenter removeObserver: self name: UIApplicationDidReceiveMemoryWarningNotification object: nil ];
22742268}
22752269
0 commit comments