All Projects → lionheart → Lhskeyboardadjusting

lionheart / Lhskeyboardadjusting

Licence: apache-2.0
An easy-to-use Objective-C protocol that automatically resizes / adjusts views when a keyboard appears on iOS.

Projects that are alternatives of or similar to Lhskeyboardadjusting

Lipika Ime
Input Method Engine (IME) for Mac OS X with built-in support for all Indic Languages
Stars: ✭ 76 (-24.75%)
Mutual labels:  keyboard
Awesome Mechanical Keyboard
⌨️ A curated list of Open Source Mechanical Keyboard resources.
Stars: ✭ 1,294 (+1181.19%)
Mutual labels:  keyboard
Minikbd
Stars: ✭ 97 (-3.96%)
Mutual labels:  keyboard
Rxkeyboard
Reactive Keyboard in iOS
Stars: ✭ 1,246 (+1133.66%)
Mutual labels:  keyboard
Simple Keyboard
Javascript Virtual Keyboard - Customizable, responsive and lightweight
Stars: ✭ 1,275 (+1162.38%)
Mutual labels:  keyboard
Gohook
GoHook, Go global keyboard and mouse listener hook
Stars: ✭ 94 (-6.93%)
Mutual labels:  keyboard
Mouse2joystick custom cemu
An AutoHotkey Script to allow the use of Mouse and Keyboard control in CEMU. This uses vJoy and provides several additional features over regular keyboard control, like: the ability to control the camera with the mouse, toggle walking speed, in BotW use MouseWheel to change weapons, a separate Toggle key for ZL useful for locking onto a target in BotW.
Stars: ✭ 76 (-24.75%)
Mutual labels:  keyboard
Digitalkeyboard
手动实现简单的身份证数字键盘
Stars: ✭ 99 (-1.98%)
Mutual labels:  keyboard
Neatinput
A .NET standard project which aims to make keyboard and mouse input monitoring easy on Windows and eventually Linux.
Stars: ✭ 89 (-11.88%)
Mutual labels:  keyboard
Bigbagkbdtrixxkb
"DreymaR's Big Bag of Keyboard Tricks" for *nix with XKB
Stars: ✭ 95 (-5.94%)
Mutual labels:  keyboard
Jp01
JP01 - Arisu Custom CNC Aluminum Unibody Keyboard Case
Stars: ✭ 84 (-16.83%)
Mutual labels:  keyboard
Audiokitsynthone
AudioKit Synth One: Open-Source iOS Synthesizer App
Stars: ✭ 1,258 (+1145.54%)
Mutual labels:  keyboard
Hallelujahim
hallelujahIM(哈利路亚 英文输入法) is an intelligent English input method with auto-suggestions and spell check features, Mac only.
Stars: ✭ 1,334 (+1220.79%)
Mutual labels:  keyboard
Arisu Case
Case design files for Arisu Keyboard
Stars: ✭ 83 (-17.82%)
Mutual labels:  keyboard
React Native Dismiss Keyboard
A simple way to dismiss the keyboard programmatically in a react native application
Stars: ✭ 97 (-3.96%)
Mutual labels:  keyboard
Keynode
Interactive Keyboard Controller for Swift
Stars: ✭ 76 (-24.75%)
Mutual labels:  keyboard
Evscript
A tiny sandboxed Dyon scripting environment for evdev input devices that lets you do e.g. xcape in Wayland
Stars: ✭ 91 (-9.9%)
Mutual labels:  keyboard
Lot60 Ble Keyboard
A 60% bluetooth keyboard (Hardware)
Stars: ✭ 100 (-0.99%)
Mutual labels:  keyboard
Swipeselection
An improvement to iOS's text editing that allows you to move the cursor and select text using gestures on the keyboard itself.
Stars: ✭ 97 (-3.96%)
Mutual labels:  keyboard
Vehicle Keyboard Ios
停车王车牌号码专用键盘 - iOS
Stars: ✭ 96 (-4.95%)
Mutual labels:  keyboard

For the Swift port of this project, please see KeyboardAdjuster.

LHSKeyboardAdjusting

CI Status Version License Platform

LHSKeyboardAdjusting will adjust the bottom position of your UIScrollView or UITableView when a keyboard appears on screen using Auto Layout. All you have to do is provide LHSKeyboardAdjusting with an NSLayoutConstraint that pins the bottom of your view to the bottom of the screen. LHSKeyboardAdjusting will automatically adjust that constraint and pin it to the top of the keyboard when it appears.

LHSKeyboardAdjusting requires Auto Layout in your build target, so it will only work with iOS 6+.

NOTE

If you're currently using LHSKeyboardAdjusting 1.0+ in your project, note that some things have changed.


Installation

LHSKeyboardAdjusting uses CocoaPods, so in your Podfile, just add something like this:

pod 'LHSKeyboardAdjusting', '~> 2.0'

Then run pod install and you'll be ready to go.

If you don't use CocoaPods, dragging and dropping the LHSKeyboardAdjusting folder into your Xcode project will do the trick as well.

Usage

  1. In your view controller's header file, assign the LHSKeyboardAdjusting protocol to your class and define an NSLayoutConstraint property called keyboardAdjustingBottomConstraint.

    #import <LHSKeyboardAdjusting/LHSKeyboardAdjusting.h>
    
    @interface ViewController : UIViewController <LHSKeyboardAdjusting>
    
    @property (nonatomic, strong) NSLayoutConstraint *keyboardAdjustingBottomConstraint;
    
    @end
    
  2. In your view controller, implement keyboardAdjustingView to return the view you'd like to pin to the top of the keyboard. It could be anything, but a UIScrollView, UITableView, or a UITextView are the most likely candidates.

    #pragma mark - LHSKeyboardAdjusting
    
    - (UIView *)keyboardAdjustingView {
        return self.tableView;
    }
    
  3. Activate and deactivate the automatic adjustments in viewWillAppear and viewWillDisappear.

    #import <LHSKeyboardAdjusting/UIViewController+LHSKeyboardAdjustment.h>
    
    @implementation ViewController
    
    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
    
        [self lhs_activateKeyboardAdjustment];
    }
    
    - (void)viewWillDisappear:(BOOL)animated {
        [super viewWillDisappear:animated];
    
        [self lhs_deactivateKeyboardAdjustment];
    }
    
    @end
    

    Note: you can also define callbacks on keyboard appearance or disappearance using lhs_activateKeyboardAdjustmentWithShow:hide::

    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
    
        [self lhs_activateKeyboardAdjustmentWithShow:^{
            NSLog(@"hi");
        } hide:^{
            NSLog(@"bai");
        }];
    }
    
  4. And you're done! Whenever a keyboard appears, this view will be automatically resized.

If you need more pointers on how to set everything up, clone this repo and check out the included example project (LHSKeyboardAdjustingExample).

License

Apache 2.0, see LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].