Skip to content

Instantly share code, notes, and snippets.

@mikeyk
Created September 8, 2011 23:31
Show Gist options
  • Save mikeyk/1205091 to your computer and use it in GitHub Desktop.
Save mikeyk/1205091 to your computer and use it in GitHub Desktop.

Revisions

  1. Mike Krieger revised this gist Sep 8, 2011. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions UINotificationKeyboardHeight.m
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    @implementation NSNotification (KeyboardHeight)

    - (CGFloat)keyboardHeight {
    CGRect bounds;
    NSValue *boundsValue = [self.userInfo objectForKey:UIKeyboardBoundsUserInfoKey];
    if (boundsValue) {
    [boundsValue getValue:&bounds];
    return bounds.size.height;
    CGRect startFrame;
    NSValue *startFrameValue = [self.userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey];
    if (startFrameValue) {
    [startFrameValue getValue:&startFrame];
    return startFrame.size.height;
    } else {
    return 0;
    }
  2. Mike Krieger revised this gist Sep 8, 2011. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions UINotificationKeyboardHeight.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    @implementation NSNotification (KeyboardHeight)

    - (CGFloat)keyboardHeight {
    CGRect bounds;
    NSValue *boundsValue = [self.userInfo objectForKey:UIKeyboardBoundsUserInfoKey];
    if (boundsValue) {
    [boundsValue getValue:&bounds];
    return bounds.size.height;
    } else {
    return 0;
    }
    }

    @end
  3. Mike Krieger revised this gist Sep 8, 2011. 2 changed files with 14 additions and 14 deletions.
    14 changes: 14 additions & 0 deletions (deprecated)UINotificationKeyboardHeight.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    @implementation NSNotification (KeyboardHeight)

    - (CGFloat)keyboardHeight {
    CGRect bounds;
    NSValue *boundsValue = [self.userInfo objectForKey:UIKeyboardBoundsUserInfoKey];
    if (boundsValue) {
    [boundsValue getValue:&bounds];
    return bounds.size.height;
    } else {
    return 0;
    }
    }

    @end
    14 changes: 0 additions & 14 deletions UINotificationKeyboardHeight.m
    Original file line number Diff line number Diff line change
    @@ -1,14 +0,0 @@
    @implementation NSNotification (KeyboardHeight)

    - (CGFloat)keyboardHeight {
    CGRect startFrame;
    NSValue *startFrameValue = [self.userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey];
    if (startFrameValue) {
    [startFrameValue getValue:&startFrame];
    return startFrame.size.height;
    } else {
    return 0;
    }
    }

    @end
  4. Mike Krieger revised this gist Sep 8, 2011. No changes.
  5. Mike Krieger revised this gist Sep 8, 2011. No changes.
  6. Mike Krieger revised this gist Sep 8, 2011. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions UINotificationKeyboardHeight.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    @implementation NSNotification (KeyboardHeight)

    - (CGFloat)keyboardHeight {
    CGRect startFrame;
    NSValue *startFrameValue = [self.userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey];
    if (startFrameValue) {
    [startFrameValue getValue:&startFrame];
    return startFrame.size.height;
    } else {
    return 0;
    }
    }

    @end
  7. Mike Krieger created this gist Sep 8, 2011.
    14 changes: 14 additions & 0 deletions UINotification+KeyboardHeight.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    @implementation NSNotification (KeyboardHeight)

    - (CGFloat)keyboardHeight {
    CGRect bounds;
    NSValue *boundsValue = [self.userInfo objectForKey:UIKeyboardBoundsUserInfoKey];
    if (boundsValue) {
    [boundsValue getValue:&bounds];
    return bounds.size.height;
    } else {
    return 0;
    }
    }

    @end