mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-03-25 09:25:47 +00:00
update link view when the pasteboard changes or app becomes active
This commit is contained in:
parent
085607795b
commit
1cfebee54e
1 changed files with 10 additions and 0 deletions
|
|
@ -185,6 +185,8 @@
|
|||
NSAssert(self.blogController, @"blogController is required");
|
||||
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
|
||||
[notificationCenter addObserver:self selector:@selector(applicationWillResignActive:) name:UIApplicationWillResignActiveNotification object:nil];
|
||||
[notificationCenter addObserver:self selector:@selector(applicationDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil];
|
||||
[notificationCenter addObserver:self selector:@selector(configureLinkView) name:UIPasteboardChangedNotification object:nil];
|
||||
[notificationCenter addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
|
||||
[notificationCenter addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
|
||||
[notificationCenter addObserver:self selector:@selector(postDeleted:) name:DraftRemovedNotification object:nil];
|
||||
|
|
@ -196,6 +198,8 @@
|
|||
[super viewWillDisappear:animated];
|
||||
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
|
||||
[notificationCenter removeObserver:self name:UIApplicationWillResignActiveNotification object:nil];
|
||||
[notificationCenter removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
|
||||
[notificationCenter removeObserver:self name:UIPasteboardChangedNotification object:nil];
|
||||
[notificationCenter removeObserver:self name:UIKeyboardWillShowNotification object:nil];
|
||||
[notificationCenter removeObserver:self name:UIKeyboardWillHideNotification object:nil];
|
||||
[notificationCenter removeObserver:self name:DraftRemovedNotification object:nil];
|
||||
|
|
@ -223,6 +227,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(NSNotification *)note {
|
||||
if (self.post) {
|
||||
[self configureView];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)keyboardWillShow:(NSNotification *)note {
|
||||
if (self.textView.isFirstResponder) {
|
||||
[self showHideKeyboardButton];
|
||||
|
|
|
|||
Loading…
Reference in a new issue