Latest 1.0.5
Homepage https://github.com/rordeix/SpiriaKeyboardAdjustment
License MIT
Platforms ios 7.0, requires ARC
Authors

At some point every mobile developer has to deal with the struggle of the keyboard and the screen layout.
Usually you have only a few screens so you probably just copy/paste the code to do it (register to keyboard notifications, and change the frame of the main view or just a constraint to the bottom of the main view). This extension does all those things for you :), automatically register to the notifications and when the keyboard appears it changes the frame of the main view or optionally modify the value of a constraint (bottom constraint to the main view). You only need to install the pod and import the library on your view controller, that’s all.
If you don’t want to resize the view on a given view controller but you already have this library included just override the property shouldAutoAdjustScreen and return NO:

-(BOOL)shouldAutoAdjustScreen {
    return NO;
}

If you want to use a constraint to the main view instead of resize the controller view, you can assign the constraint from the UIBuilder to the adjustBottomConstraint property, or just implement its getter method with the constraint you want.

Demo

Version
License
Platform

Usage

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

Requirements

Installation

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

pod "SpiriaKeyboardAdjustment"

Author

rordeix, [email protected]

License

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

Latest podspec

{
    "name": "SpiriaKeyboardAdjustment",
    "version": "1.0.5",
    "summary": "Adjust the view controller main view frame when the keyboard appears and disappears.",
    "description": "At some point every mobile developer has to deal with the struggle of the keybard and the screen layout.nUsually you have only a few screens so you probably just copy/paste the code to do it (register to keyboard notifications, and change the frame of the main view or just a constraint to the bottom of the main view). This extension does all those things for you :), automatically register to the notifications and when the keyboard appears it changes the frame of the main view or optionally modify the value of a constraint (bottom constraint to the main view). You only need to install the pod and import the library on your view controller, that is all.nIf you do not want to resize the view on a given view controller but you already have this library included just override the property shouldAutoAdjustScreen and return NO.nIf you want to use a constraint to the main view instead of resize the controller view, you can assign the constraint from the UIBuilder to the adjustBottomConstraint property, or just implements its getter method with the constraint you want.",
    "homepage": "https://github.com/rordeix/SpiriaKeyboardAdjustment",
    "license": "MIT",
    "authors": {
        "rordeix": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rordeix/SpiriaKeyboardAdjustment.git",
        "tag": "1.0.5"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This