GithubHelp home page GithubHelp logo

rordeix / spiriakeyboardadjustment Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 0.0 43 KB

Adjust the view controller view frame automatically when the keyboard appears and disappears

License: MIT License

Ruby 8.23% Objective-C 39.82% Shell 51.95%

spiriakeyboardadjustment's Introduction

SpiriaKeyboardAdjustment

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.

spiriakeyboardadjustment's People

Contributors

rordeix avatar

Stargazers

 avatar Gabriel Osorio avatar Sandeep Aggarwal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.