Skip to content

Commit

Permalink
Rename keyboard notification methods. Some overlap with UITextView in…
Browse files Browse the repository at this point in the history
…ternal methods.
  • Loading branch information
danielamitay committed Aug 3, 2012
1 parent b39ce28 commit c3099f1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions DAKeyboardControl/DAKeyboardControl.m
Expand Up @@ -55,30 +55,30 @@ - (void)addKeyboardControl:(BOOL)panning actionHandler:(DAKeyboardDidMoveBlock)a

// Register for keyboard notifications
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
selector:@selector(inputKeyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidShow:)
selector:@selector(inputKeyboardDidShow:)
name:UIKeyboardDidShowNotification
object:nil];

// For the sake of 4.X compatibility
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillChangeFrame:)
selector:@selector(inputKeyboardWillChangeFrame:)
name:@"UIKeyboardWillChangeFrameNotification"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidChangeFrame:)
selector:@selector(inputKeyboardDidChangeFrame:)
name:@"UIKeyboardDidChangeFrameNotification"
object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
selector:@selector(inputKeyboardWillHide:)
name:UIKeyboardWillHideNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidHide:)
selector:@selector(inputKeyboardDidHide:)
name:UIKeyboardDidHideNotification
object:nil];

Expand Down Expand Up @@ -172,7 +172,7 @@ - (void)responderDidBecomeActive:(NSNotification *)notification

#pragma mark - Keyboard Notifications

- (void)keyboardWillShow:(NSNotification *)notification
- (void)inputKeyboardWillShow:(NSNotification *)notification
{
CGRect keyboardEndFrameWindow;
[[notification.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue: &keyboardEndFrameWindow];
Expand All @@ -198,7 +198,7 @@ - (void)keyboardWillShow:(NSNotification *)notification
}];
}

- (void)keyboardDidShow:(NSNotification *)notification
- (void)inputKeyboardDidShow:(NSNotification *)notification
{
// Grab the keyboard view
self.keyboardActiveView = self.keyboardActiveInput.inputAccessoryView.superview;
Expand All @@ -212,7 +212,7 @@ - (void)keyboardDidShow:(NSNotification *)notification
}
}

- (void)keyboardWillChangeFrame:(NSNotification *)notification
- (void)inputKeyboardWillChangeFrame:(NSNotification *)notification
{
CGRect keyboardEndFrameWindow;
[[notification.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue: &keyboardEndFrameWindow];
Expand All @@ -236,12 +236,12 @@ - (void)keyboardWillChangeFrame:(NSNotification *)notification
}];
}

- (void)keyboardDidChangeFrame:(NSNotification *)notification
- (void)inputKeyboardDidChangeFrame:(NSNotification *)notification
{
// Nothing to see here
}

- (void)keyboardWillHide:(NSNotification *)notification
- (void)inputKeyboardWillHide:(NSNotification *)notification
{
CGRect keyboardEndFrameWindow;
[[notification.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue: &keyboardEndFrameWindow];
Expand All @@ -265,7 +265,7 @@ - (void)keyboardWillHide:(NSNotification *)notification
}];
}

- (void)keyboardDidHide:(NSNotification *)notification
- (void)inputKeyboardDidHide:(NSNotification *)notification
{
self.keyboardActiveView.hidden = NO;
self.keyboardActiveView.userInteractionEnabled = YES;
Expand Down

0 comments on commit c3099f1

Please sign in to comment.