Latest 0.2.4
Homepage https://github.com/brynbodayle/BABFrameObservingInputAccessoryView
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit
Authors

A simple view which allows for an iOS Messages style keyboard input view and panning behavior.

Sample Project

Supports iOS 7.0+

  • Free of method swizzling
  • No associated objects or other runtime hacks
  • Works easily with or without Auto Layout
  • Tested on iOS 7, iOS 8, iPhone & iPad

This is a UIView subclass which allows for observing the frame of a UITextView or UITextField’s inputAcessoryView. This allows your to keep the text field above the keyboard as it moves. Also this allows for interactive keyboard dismissal using UIScrollView’s keyboardDismissMode property.

Sample Code & Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Here is a sample viewDidLoad implementation.

- (void)viewDidLoad {
    [super viewDidLoad];

    self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;

    BABFrameObservingInputAccessoryView *inputView = [[BABFrameObservingInputAccessoryView alloc] init];
    inputView.userInteractionEnabled = NO;

    self.textField.inputAccessoryView = inputView;

    __weak typeof(self)weakSelf = self;

    inputView.keyboardFrameChangedBlock = ^(BOOL keyboardVisible, CGRect keyboardFrame){

        CGFloat value = CGRectGetHeight(weakSelf.view.frame) - CGRectGetMinY(keyboardFrame);
        weakSelf.toolbarContainerVerticalSpacingConstraint.constant = MAX(0, value);
        [weakSelf.view layoutIfNeeded];

    };
}

Requirements

  • Requires iOS 7.0+

Installation

BABFrameObservingInputAccessoryView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'BABFrameObservingInputAccessoryView'

Author

Bryn Bodayle, [email protected]

License

BABFrameObservingInputAccessoryView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "BABFrameObservingInputAccessoryView",
    "version": "0.2.4",
    "summary": "A simple view which allows for an iOS Messages style keyboard input view and panning behavior.",
    "description": "BABFrameObservingInputAccessoryViewn===================================nnA simple view which allows for an iOS Messages style keyboard input view and panning behavior.nnSupports iOS 7.0+nn* Free of method swizzlingn* No associated objects or other runtime hacksn* Works easily with or without Auto Layoutn* Tested on iOS 7, iOS 8, iPhone & iPadnnThis is a UIView subclass which allows for observing the frame of a UITextView or UITextField's inputAcessoryView. This allows your to keep the text field above the keyboard as it moves. Also this allows for interactive keyboard dismissal using UIScrollView's keyboardDismissMode property.nn### More InfonnI wrote a [blog post](http://www.brynbodayle.com/messages-style-input-view-in-ios-8/) about the history and my decisions in handling this problem.nn###FeedbacknnI'd love to here any questions, suggestions, or issues you might have. I've been using this in several of my apps, so it will remain in active development. Feel free to reach out on [Twitter](http://twitter.com/brynbodayle) or via issues if you have any feedback.",
    "homepage": "https://github.com/brynbodayle/BABFrameObservingInputAccessoryView",
    "screenshots": "http://brynbodayle.com/Files/BABCropperView.gif",
    "license": "MIT",
    "authors": {
        "Bryn Bodayle": "[email protected]"
    },
    "source": {
        "git": "https://github.com/brynbodayle/BABFrameObservingInputAccessoryView.git",
        "tag": "0.2.4"
    },
    "social_media_url": "https://twitter.com/brynbodayle",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "public_header_files": "Pod/Classes/**/*.h",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This