Skip to content

Commit

Permalink
Merge pull request #44 from kylef/unused
Browse files Browse the repository at this point in the history
Make DAKeyboardControl build with -Wunused-parameter
  • Loading branch information
danielamitay committed May 5, 2013
2 parents 465501c + 74062b0 commit 72a06f2
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions DAKeyboardControl/DAKeyboardControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ - (void)addKeyboardControl:(BOOL)panning actionHandler:(DAKeyboardDidMoveBlock)a
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(inputKeyboardDidShow:)
selector:@selector(inputKeyboardDidShow)
name:UIKeyboardDidShowNotification
object:nil];

Expand All @@ -116,7 +116,7 @@ - (void)addKeyboardControl:(BOOL)panning actionHandler:(DAKeyboardDidMoveBlock)a
name:@"UIKeyboardWillChangeFrameNotification"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(inputKeyboardDidChangeFrame:)
selector:@selector(inputKeyboardDidChangeFrame)
name:@"UIKeyboardDidChangeFrameNotification"
object:nil];

Expand All @@ -125,7 +125,7 @@ - (void)addKeyboardControl:(BOOL)panning actionHandler:(DAKeyboardDidMoveBlock)a
name:UIKeyboardWillHideNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(inputKeyboardDidHide:)
selector:@selector(inputKeyboardDidHide)
name:UIKeyboardDidHideNotification
object:nil];
}
Expand Down Expand Up @@ -218,7 +218,7 @@ - (void)responderDidBecomeActive:(NSNotification *)notification
}
self.keyboardActiveInput = (UIResponder *)textField;
// Force the keyboard active view reset
[self inputKeyboardDidShow:nil];
[self inputKeyboardDidShow];
}
}

Expand Down Expand Up @@ -246,7 +246,7 @@ - (void)inputKeyboardWillShow:(NSNotification *)notification
if (self.keyboardDidMoveBlock && !CGRectIsNull(keyboardEndFrameView))
self.keyboardDidMoveBlock(keyboardEndFrameView);
}
completion:^(BOOL finished){
completion:^(__unused BOOL finished){
if (self.panning && !self.keyboardPanRecognizer)
{
// Register for gesture recognizer calls
Expand All @@ -260,7 +260,7 @@ - (void)inputKeyboardWillShow:(NSNotification *)notification
}];
}

- (void)inputKeyboardDidShow:(NSNotification *)notification
- (void)inputKeyboardDidShow
{
// Grab the keyboard view
self.keyboardActiveView = self.keyboardActiveInput.inputAccessoryView.superview;
Expand Down Expand Up @@ -294,11 +294,10 @@ - (void)inputKeyboardWillChangeFrame:(NSNotification *)notification
if (self.keyboardDidMoveBlock && !CGRectIsNull(keyboardEndFrameView))
self.keyboardDidMoveBlock(keyboardEndFrameView);
}
completion:^(BOOL finished){
}];
completion:nil];
}

- (void)inputKeyboardDidChangeFrame:(NSNotification *)notification
- (void)inputKeyboardDidChangeFrame
{
// Nothing to see here
}
Expand All @@ -323,14 +322,14 @@ - (void)inputKeyboardWillHide:(NSNotification *)notification
if (self.keyboardDidMoveBlock && !CGRectIsNull(keyboardEndFrameView))
self.keyboardDidMoveBlock(keyboardEndFrameView);
}
completion:^(BOOL finished){
completion:^(__unused BOOL finished){
// Remove gesture recognizer when keyboard is not showing
[self removeGestureRecognizer:self.keyboardPanRecognizer];
self.keyboardPanRecognizer = nil;
}];
}

- (void)inputKeyboardDidHide:(NSNotification *)notification
- (void)inputKeyboardDidHide
{
self.keyboardActiveView.hidden = NO;
self.keyboardActiveView.userInteractionEnabled = YES;
Expand All @@ -339,8 +338,8 @@ - (void)inputKeyboardDidHide:(NSNotification *)notification

- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
change:(__unused NSDictionary *)change
context:(__unused void *)context
{
if([keyPath isEqualToString:@"frame"] && object == self.keyboardActiveView)
{
Expand Down Expand Up @@ -441,8 +440,7 @@ - (void)panGestureDidChange:(UIPanGestureRecognizer *)gesture
self.keyboardDidMoveBlock(newKeyboardViewFrameInView);
*/
}
completion:^(BOOL finished){
}];
completion:nil];
}
}
break;
Expand Down Expand Up @@ -475,7 +473,7 @@ - (void)panGestureDidChange:(UIPanGestureRecognizer *)gesture
self.keyboardDidMoveBlock(newKeyboardViewFrameInView);
*/
}
completion:^(BOOL finished){
completion:^(__unused BOOL finished){
[[self keyboardActiveView] setUserInteractionEnabled:!shouldRecede];
if (shouldRecede)
{
Expand Down

0 comments on commit 72a06f2

Please sign in to comment.