Latest 0.1.0
Homepage https://github.com/riosc/InputHandler
License MIT
Platforms ios 7.0, requires ARC
Authors

CRInputHandler

[![CI Status](http://img.shields.io/travis/Carlos Rios/CRInputHandler.svg?style=flat)](https://travis-ci.org/Carlos Rios/CRInputHandler)
Version
License
Platform

CRInputHandler is a UI Helper class that facilitates the re-location (if needed) of inputs texts like
UITextField and UITextView in iOS applications when it is on focus state. If have worked with forms in iOS
aplications before, you could note that sometimes the iOS keyboard overlap the
input text making a little painful the user experience. So this
class helps you to keep always visible the input when it is on focus.
Also this class manages the user tap actions outside input text views to hide
the keyboard.

This class works observing the events of UITextField and UITextView classes,
so it does not override any delegate method of these UIKit Component.

Life WITH CRInputHandler

input handler image yes

Life WITHOUT CRInputHandler

input handler image not

Usage

You need to put your inputs texts inside a UIScrollView and use the -(id)initWithContainer:
to init the class. Your view herarchy should looks similar like this:

 * UIView
 * |-UIScrollView
 * |--UIView
 * |  | |-UITextField
 * |  | |-UITextView
 * |--

The main goals is set the inputs views inside UIScrollView container.

Code Example:

@interface CRViewController ()
{
__weak IBOutlet UITextField * firstNameTF;
__weak IBOutlet UITextField * lastNameTF;
__weak IBOutlet UITextView * bioTV;
__weak IBOutlet UITextField * emailTF;
__weak IBOutlet UITextField * birthdayTF;

__weak IBOutlet UIScrollView * container;

}

@property (nonatomic, strong) CRInputHandler * inputHandler;
@property (nonatomic, strong) NSArray * allInputs;
@end

@implementation CRViewController

- (void)viewDidLoad {
[super viewDidLoad];

_allInputs      = @[firstNameTF, lastNameTF, bioTV, emailTF, birthdayTF];
_inputHandler   = [[CRInputHandler alloc] initWithContainer:container];
[_inputHandler setFields:_allInputs];

}

If you want take a look to Example project. To run the example project,
clone the repo, and run pod update or pod install from the Example directory first.

Requirements

iOS 6 or higher

Installation

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

pod "CRInputHandler"

and import it in your class:

#import <CRInputHandler/CRInputHandler.h>

Author

Carlos Rios, [email protected]

License

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

Latest podspec

{
    "name": "InputHandler",
    "version": "0.1.0",
    "summary": "Input handler is a helper library that facilitates set on focus an input like UITextField or UITextView in your iOS application.",
    "description": "                       InputHandler lets manage correctly the keyboard when user taps over an input. Also this class manages the keyboard hiding when user tap outside of input.n                       * Markdown format.n                       * Don't worry about the indent, we strip it!n",
    "homepage": "https://github.com/riosc/InputHandler",
    "license": "MIT",
    "authors": {
        "Carlos Rios": "[email protected]"
    },
    "source": {
        "git": "https://github.com/riosc/InputHandler.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes",
    "resource_bundles": {
        "InputHandler": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This